Skip to content

Commit 28a4d27

Browse files
committed
fix: configure project for Python 3.9+ compatibility
- Update requires-python to >=3.9 in pyproject.toml - Set ruff target-version to py39 - Set mypy python_version to 3.9 - Add Python 3.9 to supported versions in classifiers - Ignore ruff rules that require Python 3.10+ syntax: - UP007: Use X | Y for type annotations - UP038: Use X | Y in isinstance calls - UP045: Use X | None for type annotations - Fix import ordering with ruff --fix This ensures the project works with Python 3.9+ and CI linting passes.
1 parent 5c75ff3 commit 28a4d27

File tree

5 files changed

+11
-7
lines changed

5 files changed

+11
-7
lines changed

pyproject.toml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ name = "nutrient-dws"
1313
version = "1.0.2"
1414
description = "Python client library for Nutrient Document Web Services API"
1515
readme = "README.md"
16-
requires-python = ">=3.10"
16+
requires-python = ">=3.9"
1717
license = {text = "MIT"}
1818
authors = [
1919
{name = "Nutrient", email = "support@nutrient.io"},
@@ -24,6 +24,7 @@ classifiers = [
2424
"Intended Audience :: Developers",
2525
"Operating System :: OS Independent",
2626
"Programming Language :: Python :: 3",
27+
"Programming Language :: Python :: 3.9",
2728
"Programming Language :: Python :: 3.10",
2829
"Programming Language :: Python :: 3.11",
2930
"Programming Language :: Python :: 3.12",
@@ -61,7 +62,7 @@ Repository = "https://github.com/PSPDFKit/nutrient-dws-client-python"
6162
nutrient_dws = ["py.typed"]
6263

6364
[tool.ruff]
64-
target-version = "py310"
65+
target-version = "py39"
6566
line-length = 100
6667

6768
[tool.ruff.lint]
@@ -83,6 +84,9 @@ ignore = [
8384
"D100", # Missing docstring in public module
8485
"D104", # Missing docstring in public package
8586
"D107", # Missing docstring in __init__
87+
"UP007", # Use X | Y for type annotations (requires Python 3.10+)
88+
"UP038", # Use X | Y in isinstance call (requires Python 3.10+)
89+
"UP045", # Use X | None for type annotations (requires Python 3.10+)
8690
]
8791

8892
[tool.ruff.lint.pydocstyle]
@@ -92,7 +96,7 @@ convention = "google"
9296
"tests/*" = ["D", "S101"] # Don't require docstrings in tests, allow asserts
9397

9498
[tool.mypy]
95-
python_version = "3.10"
99+
python_version = "3.9"
96100
strict = true
97101
warn_return_any = true
98102
warn_unused_ignores = false

src/nutrient_dws/api/direct.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
for supported document processing operations.
55
"""
66

7-
from typing import TYPE_CHECKING, Any, Protocol, Optional, Union
7+
from typing import TYPE_CHECKING, Any, Optional, Protocol, Union
88

99
from nutrient_dws.file_handler import FileInput
1010

src/nutrient_dws/file_handler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import os
66
from collections.abc import Generator
77
from pathlib import Path
8-
from typing import BinaryIO, Union, Optional
8+
from typing import BinaryIO, Optional, Union
99

1010
FileInput = Union[str, Path, bytes, BinaryIO]
1111

tests/integration/test_direct_api_integration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
test all Direct API methods against the live Nutrient DWS API.
55
"""
66

7-
from typing import Union, Optional
7+
from typing import Optional, Union
88

99
import pytest
1010

tests/integration/test_new_tools_integration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"""
66

77
from pathlib import Path
8-
from typing import Union, Optional
8+
from typing import Optional, Union
99

1010
import pytest
1111

0 commit comments

Comments
 (0)