Skip to content

Commit f7b6efb

Browse files
committed
Drop support for Python 3.9, add support for Python 3.14, upgrade dependencies
Python 3.9 is EOL and coverage 7.11.0 supports only Python >= 3.10
1 parent 5282d39 commit f7b6efb

File tree

9 files changed

+47
-37
lines changed

9 files changed

+47
-37
lines changed

.coveragerc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
[run]
2+
core = ctrace
23
plugins = Cython.Coverage
34
source = libzim

.github/workflows/QA.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- name: Set up Python
1515
uses: actions/setup-python@v6
1616
with:
17-
python-version: "3.13"
17+
python-version: "3.14"
1818
architecture: x64
1919

2020
- name: Install dependencies (and project)

.github/workflows/Tests.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
strategy:
1414
matrix:
1515
os: [macos-13, windows-2022, ubuntu-24.04]
16-
python: ["3.9", "3.10", "3.11", "3.12", "3.13"]
16+
python: ["3.10", "3.11", "3.12", "3.13", "3.14"]
1717

1818
steps:
1919
- uses: actions/checkout@v5
@@ -39,7 +39,11 @@ jobs:
3939

4040
- name: Upload coverage report to codecov
4141
if: matrix.os == 'ubuntu-24.04' && matrix.python == '3.14'
42+
<<<<<<< HEAD
4243
uses: codecov/codecov-action@v5
44+
=======
45+
uses: codecov/codecov-action@v4
46+
>>>>>>> 89f9199 (Add support for Python 3.14 and upgrade dependencies)
4347
with:
4448
fail_ci_if_error: true
4549
token: ${{ secrets.CODECOV_TOKEN }}

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Changed
11+
12+
- Drop support of Python 3.9, add support for Python 3.14, upgrade dependencies (#237)
13+
1014
## [3.7.0] - 2025-04-18
1115

1216
### Added

libzim/writer.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ class Blob:
2323
class ContentProvider:
2424
def feed(self) -> Blob: ...
2525
def get_size(self) -> int: ...
26-
def gen_blob(self) -> Generator[Blob, None, None]: ...
26+
def gen_blob(self) -> Generator[Blob]: ...
2727

28-
generator: Generator[Blob, None, None]
28+
generator: Generator[Blob]
2929

3030
class StringProvider(ContentProvider):
3131
def __init__(self, content: str | bytes) -> None: ...

pyproject.toml

Lines changed: 27 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
[build-system]
22
requires = [
3-
"setuptools == 74.1.1",
4-
"wheel == 0.44.0",
5-
"cython == 3.0.11",
3+
"setuptools == 80.9.0",
4+
"wheel == 0.45.1",
5+
"cython == 3.1.6",
66
# https://github.com/pypa/cibuildwheel/blob/v2.22/cibuildwheel/resources/constraints.txt
7-
"delocate == 0.12.0 ; platform_system=='Windows'",
7+
"delocate == 0.13.0 ; platform_system=='Windows'",
88
]
99
build-backend = "setuptools.build_meta"
1010

1111
[project]
1212
name = "libzim"
1313
version = "3.7.1-dev0"
14-
requires-python = ">=3.9,<3.14"
14+
requires-python = ">=3.10,<3.15"
1515
description = "A python-facing API for creating and interacting with ZIM files"
1616
authors = [
1717
{name = "openZIM", email = "[email protected]"},
@@ -30,11 +30,11 @@ classifiers = [
3030
"Intended Audience :: Developers",
3131
"Programming Language :: Cython",
3232
"Programming Language :: Python :: 3",
33-
"Programming Language :: Python :: 3.9",
3433
"Programming Language :: Python :: 3.10",
3534
"Programming Language :: Python :: 3.11",
3635
"Programming Language :: Python :: 3.12",
3736
"Programming Language :: Python :: 3.13",
37+
"Programming Language :: Python :: 3.14",
3838
"Typing :: Stubs Only",
3939
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
4040
"Operating System :: MacOS",
@@ -50,43 +50,43 @@ scripts = [
5050
"invoke==2.2.0",
5151
]
5252
lint = [
53-
"black==25.1.0",
54-
"ruff==0.9.5",
53+
"black==25.9.0",
54+
"ruff==0.14.3",
5555
"libzim",
5656
"libzim[build]",
5757
]
5858
check = [
59-
"pyright==1.1.393",
59+
"pyright==1.1.407",
6060
"libzim",
6161
"libzim[build]",
6262
"libzim[test]",
6363
"types-setuptools",
6464
]
6565
test = [
66-
"pytest==8.3.4",
67-
"coverage==7.6.10",
66+
"pytest==8.4.2",
67+
"coverage==7.11.0",
6868
# for cython coverage plugin
6969
"libzim[build]",
7070
]
7171
build = [
72-
"setuptools == 75.8.0",
72+
"setuptools == 80.9.0",
7373
"wheel == 0.45.1",
74-
"cython == 3.0.11",
75-
"delocate == 0.12.0 ; platform_system=='Windows'",
74+
"cython == 3.1.6",
75+
"delocate == 0.13.0 ; platform_system=='Windows'",
7676
]
7777
docs = [
7878
"mkdocs==1.6.1",
79-
"mkdocstrings-python==1.14.5",
80-
"mkdocs-material==9.5.49",
81-
"pymdown-extensions==10.14",
79+
"mkdocstrings-python==1.18.2",
80+
"mkdocs-material==9.6.23",
81+
"pymdown-extensions==10.16.1",
8282
"mkdocs-gen-files==0.5.0",
83-
"mkdocs-literate-nav==0.6.1",
84-
"mkdocs-include-markdown-plugin==7.1.2",
85-
"griffe==1.5.6",
83+
"mkdocs-literate-nav==0.6.2",
84+
"mkdocs-include-markdown-plugin==7.2.0",
85+
"griffe==1.14.0",
8686
]
8787
dev = [
88-
"pre-commit==4.1.0",
89-
"ipython==8.32.0",
88+
"pre-commit==4.3.0",
89+
"ipython==9.6.0",
9090
"types-setuptools",
9191
"libzim[scripts]",
9292
"libzim[lint]",
@@ -139,10 +139,8 @@ archs = ["x86_64", "aarch64"]
139139
archs = ["x86_64", "arm64"]
140140
# macOS arm64 is cross-compiled and can not be tested.
141141
# cibuildwheel skips it already. *_arm64 this removes the warning
142-
# skipping tests on cp <=3.9 as the wheels we produce are on unexpected combinations
143-
# because those python versions were released before our building host version
144142
# > requires changing wheel names
145-
test-skip = "*_arm64 cp39*"
143+
test-skip = "*_arm64"
146144

147145
[tool.hatch.build]
148146
exclude = [
@@ -168,7 +166,7 @@ features = ["scripts", "test"]
168166
PROFILE = "1"
169167

170168
[[tool.hatch.envs.test.matrix]]
171-
python = ["3.9", "3.10", "3.11", "3.12", "3.13"]
169+
python = ["3.10", "3.11", "3.12", "3.13", "3.14"]
172170

173171
[tool.hatch.envs.test.scripts]
174172
run = "inv test --args '{args}'"
@@ -206,10 +204,10 @@ all = "inv checkall --args '{args}'"
206204

207205
[tool.black]
208206
line-length = 88
209-
target-version = ['py312']
207+
target-version = ['py314']
210208

211209
[tool.ruff]
212-
target-version = "py312"
210+
target-version = "py314"
213211
line-length = 88
214212
src = ["src"]
215213

@@ -336,6 +334,6 @@ exclude_lines = [
336334
[tool.pyright]
337335
include = ["libzim", "tests", "tasks.py"]
338336
exclude = [".env/**", ".venv/**"]
339-
pythonVersion = "3.13"
337+
pythonVersion = "3.14"
340338
typeCheckingMode="basic"
341339
disableBytesTypePromotions = true

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ def repair_windows_wheel(self, wheel: Path, dest_dir: Path):
349349
"""opens windows wheels in target folder and moves all DLLs files inside
350350
subdirectories of the wheel to the root one (where wrapper is expected)"""
351351

352-
from delocate.wheeltools import InWheel
352+
from delocate.wheeltools import InWheel # noqa : PLC0415
353353

354354
# we're only interested in windows wheels
355355
if not re.match(r"libzim-.+-win_.+", wheel.stem):

tests/test_libzim_creator.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,10 @@ def test_creator_additem(fpath, lipsum_item):
373373
c.add_item(None) # pyright: ignore [reportCallIssue, reportArgumentType]
374374
with pytest.raises(RuntimeError):
375375
c.add_item("hello") # pyright: ignore [reportCallIssue, reportArgumentType]
376-
with pytest.raises(TypeError, match="takes exactly 1 positional argument"):
376+
with pytest.raises(
377+
TypeError,
378+
match="got an unexpected keyword argument 'mimetype'",
379+
):
377380
c.add_item(mimetype="text/html") # pyright: ignore [reportCallIssue]
378381

379382

tests/test_libzim_version.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111
def test_version_print_version_with_stdout(capsys):
1212
print_versions()
1313
print("", file=sys.stdout, flush=True)
14-
stdout, stderr = capsys.readouterr()
14+
stdout, _stderr = capsys.readouterr()
1515
assert len(stdout) != 0
1616

1717

1818
def test_version_print_version_with_stderr(capsys):
1919
print_versions(sys.stderr)
2020
print("", file=sys.stderr, flush=True)
21-
stdout, stderr = capsys.readouterr()
21+
_stdout, stderr = capsys.readouterr()
2222
assert len(stderr) != 0
2323

2424

0 commit comments

Comments
 (0)