From ea9963f657bfe5d702d96516390f6176f429489c Mon Sep 17 00:00:00 2001 From: rgaudin Date: Thu, 13 Aug 2026 16:26:40 +0000 Subject: [PATCH 1/8] Update build dependencies --- pyproject.toml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 25fb59eb..08ea0853 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,8 +1,8 @@ [build-system] requires = [ - "setuptools == 83.0.0", - "wheel == 0.47.0", - "cython == 3.2.8", + "setuptools == 84.0.0", + "wheel == 0.48.0", + "cython == 3.2.9", # https://github.com/pypa/cibuildwheel/blob/v2.22/cibuildwheel/resources/constraints.txt "delocate == 0.13.0 ; platform_system=='Windows'", ] @@ -68,9 +68,9 @@ test = [ "libzim[build]", ] build = [ - "setuptools == 83.0.0", - "wheel == 0.47.0", - "cython == 3.2.8", + "setuptools == 84.0.0", + "wheel == 0.48.0", + "cython == 3.2.9", "delocate == 0.13.0 ; platform_system=='Windows'", ] docs = [ From dba73c40d0bd3931506322eb8d2ad3734cf3fad4 Mon Sep 17 00:00:00 2001 From: rgaudin Date: Thu, 13 Aug 2026 16:38:29 +0000 Subject: [PATCH 2/8] Removed support for Python 3.10 (EOL) --- .github/workflows/Tests.yaml | 2 +- CHANGELOG.md | 4 ++++ pyproject.toml | 5 ++--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/Tests.yaml b/.github/workflows/Tests.yaml index 479feb18..36112e92 100644 --- a/.github/workflows/Tests.yaml +++ b/.github/workflows/Tests.yaml @@ -13,7 +13,7 @@ jobs: strategy: matrix: os: [macos-14, macos-15, macos-15-intel, windows-2022, windows-2025, ubuntu-22.04, ubuntu-24.04] - python: ["3.10", "3.11", "3.12", "3.13", "3.14", "3.14t"] + python: ["3.11", "3.12", "3.13", "3.14", "3.14t"] steps: - uses: actions/checkout@v6 diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c9be8d4..e5fb7231 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Removed + +- Support for Python 3.10 (EOL) + ## [3.12.0] - 2026-07-20 ### Changed diff --git a/pyproject.toml b/pyproject.toml index 08ea0853..234c64dd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,7 +11,7 @@ build-backend = "setuptools.build_meta" [project] name = "libzim" version = "3.12.1-dev0" -requires-python = ">=3.10,<3.15" +requires-python = ">=3.11,<3.15" description = "A python-facing API for creating and interacting with ZIM files" authors = [ {name = "openZIM", email = "dev@kiwix.org"}, @@ -30,7 +30,6 @@ classifiers = [ "Intended Audience :: Developers", "Programming Language :: Cython", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", @@ -170,7 +169,7 @@ features = ["scripts", "test"] PROFILE = "1" [[tool.hatch.envs.test.matrix]] -python = ["3.10", "3.11", "3.12", "3.13", "3.14"] +python = ["3.11", "3.12", "3.13", "3.14"] [tool.hatch.envs.test.scripts] run = "inv test --args '{args}'" From 470f19e5bd6b1c17b3cd9cccbbe5f0e7ef4efaa1 Mon Sep 17 00:00:00 2001 From: rgaudin Date: Thu, 13 Aug 2026 16:38:41 +0000 Subject: [PATCH 3/8] Build ABI3 wheels --- setup.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/setup.py b/setup.py index 4cd8474d..ee9740c7 100755 --- a/setup.py +++ b/setup.py @@ -383,6 +383,11 @@ def can_sign_apple(self) -> bool: ] ) + @property + def can_use_limited_api(self) -> bool: + """whether runtime can use ABIv3 (free-threaded cannot)""" + return not self.profiling and not sysconfig.get_config_var("Py_GIL_DISABLED") + config = Config() @@ -400,6 +405,8 @@ def get_cython_extension() -> list[Extension]: ("CYTHON_USE_SYS_MONITORING", "0"), ] compiler_directives.update(linetrace="true") + elif config.can_use_limited_api: + define_macros += [("Py_LIMITED_API", "0x030B0000")] include_dirs: list[str] = [] library_dirs: list[str] = [] @@ -455,6 +462,7 @@ def get_cython_extension() -> list[Extension]: extra_compile_args=extra_compile_args, language="c++", define_macros=define_macros, + py_limited_api=config.can_use_limited_api, ) return cythonize([wrapper_extension], compiler_directives=compiler_directives) @@ -634,4 +642,7 @@ def run(self): "repair_win_wheel": RepairWindowsWheel, }, ext_modules=ext_modules, + options={"bdist_wheel": {"py_limited_api": "cp311"}} + if config.can_use_limited_api + else {}, ) From 0a080042f2825ea4d73a94a64ba7fc71ee2b7f64 Mon Sep 17 00:00:00 2001 From: rgaudin Date: Thu, 13 Aug 2026 17:10:38 +0000 Subject: [PATCH 4/8] Update cibuildwheel --- .github/workflows/CI-wheels.yaml | 2 +- .github/workflows/Publish.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI-wheels.yaml b/.github/workflows/CI-wheels.yaml index d15f086d..5bba56e7 100644 --- a/.github/workflows/CI-wheels.yaml +++ b/.github/workflows/CI-wheels.yaml @@ -31,7 +31,7 @@ jobs: platforms: all - name: Build wheels - uses: pypa/cibuildwheel@v3.4 + uses: pypa/cibuildwheel@v4.2 - uses: actions/upload-artifact@v7 with: diff --git a/.github/workflows/Publish.yaml b/.github/workflows/Publish.yaml index bf243883..aff9414f 100644 --- a/.github/workflows/Publish.yaml +++ b/.github/workflows/Publish.yaml @@ -68,7 +68,7 @@ jobs: security unlock-keychain -p mysecretpassword ${APPLE_SIGNING_KEYCHAIN_PATH} - name: Build wheels - uses: pypa/cibuildwheel@v3.4 + uses: pypa/cibuildwheel@v4.2 - name: Cleanup Apple Keychain if: matrix.os == 'macos-14' From 7d7c7aa77795ae0f9c9c7e6ebcd7771aad314a1c Mon Sep 17 00:00:00 2001 From: benoit74 Date: Fri, 21 Aug 2026 18:50:00 +0000 Subject: [PATCH 5/8] Fix .so extension --- setup.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/setup.py b/setup.py index ee9740c7..2b86293c 100755 --- a/setup.py +++ b/setup.py @@ -468,6 +468,15 @@ def get_cython_extension() -> list[Extension]: class LibzimBuildExt(build_ext): + + def get_ext_filename(self, ext_name): + # set proper abi3 extension + filename = super().get_ext_filename(ext_name) + if config.can_use_limited_api: + ext_suffix = sysconfig.get_config_var("EXT_SUFFIX") + filename = filename[: -len(ext_suffix)] + ".abi3" + os.path.splitext(ext_suffix)[1] + return filename + def finalize_options(self): """Workaround for rpath bug in distutils for macOS""" super().finalize_options() From dd6122c6075d6f2c5dd1ad526f70558169b279b7 Mon Sep 17 00:00:00 2001 From: benoit74 Date: Fri, 21 Aug 2026 19:23:24 +0000 Subject: [PATCH 6/8] Continue other matrix OS on failure --- .github/workflows/CI-wheels.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/CI-wheels.yaml b/.github/workflows/CI-wheels.yaml index 5bba56e7..f670860c 100644 --- a/.github/workflows/CI-wheels.yaml +++ b/.github/workflows/CI-wheels.yaml @@ -18,6 +18,7 @@ jobs: name: Build wheels on ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: os: [macos-14, windows-2022, ubuntu-24.04] From d9cf5f89f92363fbbaca8e44f0fe17bea53aa24d Mon Sep 17 00:00:00 2001 From: benoit74 Date: Fri, 21 Aug 2026 19:34:05 +0000 Subject: [PATCH 7/8] Fix filename on Windows --- setup.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index 2b86293c..5d619485 100755 --- a/setup.py +++ b/setup.py @@ -470,13 +470,22 @@ def get_cython_extension() -> list[Extension]: class LibzimBuildExt(build_ext): def get_ext_filename(self, ext_name): - # set proper abi3 extension + # set proper filename for abi3 usage on all Python versions filename = super().get_ext_filename(ext_name) - if config.can_use_limited_api: + + if not config.can_use_limited_api: + return filename + + if config.platform == "Windows": + ext_path = ext_name.split(".") + return os.path.join(*ext_path) + ".pyd" + else: ext_suffix = sysconfig.get_config_var("EXT_SUFFIX") - filename = filename[: -len(ext_suffix)] + ".abi3" + os.path.splitext(ext_suffix)[1] + filename = ( + filename[: -len(ext_suffix)] + ".abi3" + os.path.splitext(ext_suffix)[1] + ) return filename - + def finalize_options(self): """Workaround for rpath bug in distutils for macOS""" super().finalize_options() From 737c9abd0a9db1fbf5a4ab123d513e46f9bba777 Mon Sep 17 00:00:00 2001 From: benoit74 Date: Fri, 21 Aug 2026 19:51:14 +0000 Subject: [PATCH 8/8] Fix linting --- setup.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 5d619485..76574d9c 100755 --- a/setup.py +++ b/setup.py @@ -660,7 +660,9 @@ def run(self): "repair_win_wheel": RepairWindowsWheel, }, ext_modules=ext_modules, - options={"bdist_wheel": {"py_limited_api": "cp311"}} - if config.can_use_limited_api - else {}, + options=( + {"bdist_wheel": {"py_limited_api": "cp311"}} + if config.can_use_limited_api + else {} + ), )