Skip to content

Commit f2b3a59

Browse files
authored
Merge pull request #237 from openzim/python-3.14
Add support for Python 3.14, upgrade dependencies and CI actions, upgrade macOS support to 14.0+, add free-threaded CPython
2 parents 1004cf3 + 82b5eac commit f2b3a59

File tree

12 files changed

+109
-70
lines changed

12 files changed

+109
-70
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/CI-wheels.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ jobs:
1919
runs-on: ${{ matrix.os }}
2020
strategy:
2121
matrix:
22-
os: [macos-13, windows-2022, ubuntu-24.04]
22+
os: [macos-14, windows-2022, ubuntu-24.04]
2323

2424
steps:
25-
- uses: actions/checkout@v4
25+
- uses: actions/checkout@v5
2626

2727
- name: Set up QEMU
2828
if: runner.os == 'Linux'
@@ -31,9 +31,9 @@ jobs:
3131
platforms: all
3232

3333
- name: Build wheels
34-
uses: pypa/cibuildwheel@v2.22
34+
uses: pypa/cibuildwheel@v3.2
3535

36-
- uses: actions/upload-artifact@v4
36+
- uses: actions/upload-artifact@v5
3737
with:
3838
name: wheels-${{ matrix.os }}
3939
path: ./wheelhouse/*.whl
@@ -42,12 +42,12 @@ jobs:
4242
name: Build source distribution
4343
runs-on: ubuntu-latest
4444
steps:
45-
- uses: actions/checkout@v4
45+
- uses: actions/checkout@v5
4646

4747
- name: Build sdist
4848
run: pipx run build --sdist
4949

50-
- uses: actions/upload-artifact@v4
50+
- uses: actions/upload-artifact@v5
5151
with:
5252
name: sdist
5353
path: dist/*.tar.gz

.github/workflows/Publish.yaml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ jobs:
2222
runs-on: ${{ matrix.os }}
2323
strategy:
2424
matrix:
25-
os: [ubuntu-24.04, macos-13, windows-2022]
25+
os: [ubuntu-24.04, macos-14, windows-2022]
2626

2727
steps:
28-
- uses: actions/checkout@v4
28+
- uses: actions/checkout@v5
2929

3030
- name: Set up QEMU
3131
if: runner.os == 'Linux'
@@ -34,7 +34,7 @@ jobs:
3434
platforms: all
3535

3636
- name: Prepare Apple Keychain for Signing
37-
if: matrix.os == 'macos-13'
37+
if: matrix.os == 'macos-14'
3838
shell: bash
3939
run: |
4040
# store certificate on filesystem
@@ -68,17 +68,17 @@ jobs:
6868
security unlock-keychain -p mysecretpassword ${APPLE_SIGNING_KEYCHAIN_PATH}
6969
7070
- name: Build wheels
71-
uses: pypa/cibuildwheel@v2.22
71+
uses: pypa/cibuildwheel@v3.2
7272

7373
- name: Cleanup Apple Keychain
74-
if: matrix.os == 'macos-13'
74+
if: matrix.os == 'macos-14'
7575
shell: bash
7676
run: |
7777
security lock-keychain ${APPLE_SIGNING_KEYCHAIN_PATH}
7878
security delete-keychain ${APPLE_SIGNING_KEYCHAIN_PATH}
7979
rm -f ${APPLE_SIGNING_KEYCHAIN_PATH}
8080
81-
- uses: actions/upload-artifact@v4
81+
- uses: actions/upload-artifact@v5
8282
with:
8383
name: wheels-${{ matrix.os }}
8484
path: ./wheelhouse/*.whl
@@ -87,12 +87,12 @@ jobs:
8787
name: Build source distribution
8888
runs-on: ubuntu-latest
8989
steps:
90-
- uses: actions/checkout@v4
90+
- uses: actions/checkout@v5
9191

9292
- name: Build sdist
9393
run: pipx run build --sdist
9494

95-
- uses: actions/upload-artifact@v4
95+
- uses: actions/upload-artifact@v5
9696
with:
9797
name: sdist
9898
path: dist/*.tar.gz
@@ -103,24 +103,24 @@ jobs:
103103
environment: release
104104
steps:
105105
# retrieve all artifacts
106-
- uses: actions/download-artifact@v4
106+
- uses: actions/download-artifact@v6
107107
with:
108108
name: sdist
109109
path: dist
110-
- uses: actions/download-artifact@v4
110+
- uses: actions/download-artifact@v6
111111
with:
112112
name: wheels-ubuntu-24.04
113113
path: dist
114-
- uses: actions/download-artifact@v4
114+
- uses: actions/download-artifact@v6
115115
with:
116-
name: wheels-macos-13
116+
name: wheels-macos-14
117117
path: dist
118-
- uses: actions/download-artifact@v4
118+
- uses: actions/download-artifact@v6
119119
with:
120120
name: wheels-windows-2022
121121
path: dist
122122

123-
- uses: pypa/gh-action-pypi-publish@v1.9.0
123+
- uses: pypa/gh-action-pypi-publish@v1.13.0
124124
with:
125125
user: __token__
126126
# password: ${{ secrets.PYPI_TEST_API_TOKEN }}

.github/workflows/QA.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ jobs:
99
lint:
1010
runs-on: ubuntu-24.04
1111
steps:
12-
- uses: actions/checkout@v4
12+
- uses: actions/checkout@v5
1313

1414
- name: Set up Python
15-
uses: actions/setup-python@v5
15+
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: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,34 +12,35 @@ jobs:
1212
runs-on: ${{ matrix.os }}
1313
strategy:
1414
matrix:
15-
os: [macos-13, windows-2022, ubuntu-24.04]
16-
python: ["3.9", "3.10", "3.11", "3.12", "3.13"]
15+
os: [macos-14, macos-15, macos-15-intel, windows-2022, windows-2025, ubuntu-22.04, ubuntu-24.04]
16+
python: ["3.10", "3.11", "3.12", "3.13", "3.13t", "3.14", "3.14t"]
1717

1818
steps:
19-
- uses: actions/checkout@v4
19+
- uses: actions/checkout@v5
2020

2121
- name: Set up Python ${{ matrix.python }}
22-
uses: actions/setup-python@v5
22+
uses: actions/setup-python@v6
2323
with:
2424
python-version: ${{ matrix.python }}
25-
architecture: x64
2625

26+
- name: Display Python version
27+
run: python -VV
2728

2829
- name: Install dependencies (and project)
2930
run: |
3031
pip install -U pip
3132
pip install -e .[test,scripts]
3233
3334
- name: move DLLs next to wrapper
34-
if: matrix.os == 'windows-2022'
35+
if: startsWith(matrix.os, 'windows-')
3536
run: Move-Item -Force -Path .\libzim\*.dll -Destination .\
3637

3738
- name: Run the tests
3839
run: inv coverage --args "-vvv"
3940

4041
- name: Upload coverage report to codecov
41-
if: matrix.os == 'ubuntu-24.04' && matrix.python == '3.13'
42-
uses: codecov/codecov-action@v4
42+
if: matrix.os == 'ubuntu-24.04' && matrix.python == '3.14'
43+
uses: codecov/codecov-action@v5
4344
with:
4445
fail_ci_if_error: true
4546
token: ${{ secrets.CODECOV_TOKEN }}

CHANGELOG.md

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

88
## [Unreleased]
99

10+
### Changed
11+
12+
- Maintenance upgrades (#237):
13+
- Drop support of Python 3.9
14+
- Add support for Python 3.14
15+
- Upgrade dependencies, especially Cython 3.1.6
16+
- Upgrade supported macOS to 14.0+ (instead of 13.0+)
17+
- Add support for free-threaded CPython (3.13 and 3.14)
18+
- Upgrade Github CI Actions
19+
- Run tests on minimum supported platforms + more recent stable ones
20+
1021
## [3.7.0] - 2025-04-18
1122

1223
### Added

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ Our [PyPI wheels](https://pypi.org/project/libzim/) bundle a [recent release](ht
2929

3030
Wheels are available for CPython only (but can be built for Pypy).
3131

32+
Free-threaded CPython is not supported. If you use a free-threaded CPython, GIL must be turned on (using the environment variable PYTHON_GIL or the command-line option -X gil). If you don't turn it on yourself, GIL will be forced-on and you will get a warning. Only few methods support the GIL to be disabled.
33+
3234
Users on other platforms can install the source distribution (see [Building](#Building) below).
3335

3436

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: 34 additions & 31 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]",
@@ -123,6 +123,11 @@ skip = "pp* *win32*"
123123
test-requires = ["pytest"]
124124
test-command = "py.test {project}/tests/"
125125

126+
# Override test command for free-threaded builds to force GIL on
127+
[[tool.cibuildwheel.overrides]]
128+
select = "cp313t-* cp314t-*"
129+
test-command = "python -X gil=1 -m pytest {project}/tests/"
130+
126131
manylinux-x86_64-image = "manylinux_2_28"
127132
manylinux-aarch64-image = "manylinux_2_28"
128133
manylinux-pypy_x86_64-image = "manylinux_2_28"
@@ -137,12 +142,10 @@ archs = ["x86_64", "aarch64"]
137142

138143
[tool.cibuildwheel.macos]
139144
archs = ["x86_64", "arm64"]
140-
# macOS arm64 is cross-compiled and can not be tested.
141-
# 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
145+
# macOS x86_64 is cross-compiled and can not be tested.
146+
# cibuildwheel skips it already. *_x86_64 this removes the warning
144147
# > requires changing wheel names
145-
test-skip = "*_arm64 cp39*"
148+
test-skip = "*_x86_64"
146149

147150
[tool.hatch.build]
148151
exclude = [
@@ -168,7 +171,7 @@ features = ["scripts", "test"]
168171
PROFILE = "1"
169172

170173
[[tool.hatch.envs.test.matrix]]
171-
python = ["3.9", "3.10", "3.11", "3.12", "3.13"]
174+
python = ["3.10", "3.11", "3.12", "3.13", "3.14"]
172175

173176
[tool.hatch.envs.test.scripts]
174177
run = "inv test --args '{args}'"
@@ -206,10 +209,10 @@ all = "inv checkall --args '{args}'"
206209

207210
[tool.black]
208211
line-length = 88
209-
target-version = ['py312']
212+
target-version = ['py314']
210213

211214
[tool.ruff]
212-
target-version = "py312"
215+
target-version = "py314"
213216
line-length = 88
214217
src = ["src"]
215218

@@ -336,6 +339,6 @@ exclude_lines = [
336339
[tool.pyright]
337340
include = ["libzim", "tests", "tasks.py"]
338341
exclude = [".env/**", ".venv/**"]
339-
pythonVersion = "3.13"
342+
pythonVersion = "3.14"
340343
typeCheckingMode="basic"
341344
disableBytesTypePromotions = true

0 commit comments

Comments
 (0)