From 5f655b7e6aa317494e5bb6d5aa823561bf1609d1 Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Wed, 8 Oct 2025 04:32:15 -0700 Subject: [PATCH] feat: enable future-compatible deployments Free-threaded builds are exempt from abi3 builds --- .gitignore | 1 + setup.py | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/.gitignore b/.gitignore index 12c3a970..a57da364 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ /build/ /ci/ /dist/ +/wheelhouse/ /docs/_build/ /MANIFEST /venv* diff --git a/setup.py b/setup.py index e2c62829..7e6d7034 100644 --- a/setup.py +++ b/setup.py @@ -28,6 +28,7 @@ # Import setuptools before distutils to avoid user warning import os import sys +import sysconfig from distutils import log # type: ignore[attr-defined] from distutils.command.build import build from distutils.command.sdist import sdist @@ -152,6 +153,16 @@ def run(self) -> None: cmdclass=cmdclass, cffi_modules=['pygit2/_run.py:ffi'], ext_modules=ext_modules, + options={ + 'bdist_wheel': { + # for ABI3 (future-compatible) wheels. + # NOTE: free-threaded CPython builds do not support the limited API yet. + # See https://github.com/python/cpython/issues/111506 + 'py_limited_api': False + if sysconfig.get_config_var('Py_GIL_DISABLED') + else 'cp310' # should correspond to `python_requires` below + } + }, # Requirements python_requires='>=3.10', setup_requires=['cffi>=2.0'],