Skip to content

Commit 615db5f

Browse files
committed
feat: enable future-compatible deployments
Free-threaded builds are exempt from abi3 builds
1 parent d0a1743 commit 615db5f

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
/build/
77
/ci/
88
/dist/
9+
/wheelhouse/
910
/docs/_build/
1011
/MANIFEST
1112
/venv*

setup.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
from distutils.command.sdist import sdist
3434
from pathlib import Path
3535
from subprocess import PIPE, Popen
36+
import sysconfig
3637

3738
from setuptools import Extension, setup
3839

@@ -152,6 +153,16 @@ def run(self) -> None:
152153
cmdclass=cmdclass,
153154
cffi_modules=['pygit2/_run.py:ffi'],
154155
ext_modules=ext_modules,
156+
options={
157+
'bdist_wheel': {
158+
# for ABI3 (future-compatible) wheels.
159+
# NOTE: free-threaded CPython builds do not support the limited API yet.
160+
# See https://github.com/python/cpython/issues/111506
161+
'py_limited_api': False
162+
if sysconfig.get_config_var('Py_GIL_DISABLED')
163+
else 'cp310' # should correspond to `python_requires` below
164+
}
165+
},
155166
# Requirements
156167
python_requires='>=3.10',
157168
setup_requires=['cffi>=2.0'],

uv.lock

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)