Skip to content

Commit 891f8b4

Browse files
committed
Build ABI3 wheels only for Python>=3.10
1 parent 8c2a322 commit 891f8b4

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

setup.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import os
44
import sys
5+
import sysconfig
56

67
from Cython.Build import cythonize
78
from Cython.Compiler import Options
@@ -11,6 +12,8 @@
1112
limited_api = (
1213
os.environ.get("DEPENDENCY_INJECTOR_LIMITED_API") == "1"
1314
and sys.implementation.name == "cpython"
15+
and sys.version_info >= (3, 10)
16+
and not sysconfig.get_config_var("Py_GIL_DISABLED")
1417
)
1518
defined_macros = []
1619
options = {}
@@ -34,8 +37,8 @@
3437

3538
if limited_api:
3639
options.setdefault("bdist_wheel", {})
37-
options["bdist_wheel"]["py_limited_api"] = "cp38"
38-
defined_macros.append(("Py_LIMITED_API", "0x03080000"))
40+
options["bdist_wheel"]["py_limited_api"] = "cp310"
41+
defined_macros.append(("Py_LIMITED_API", "0x030A0000"))
3942

4043
setup(
4144
options=options,

0 commit comments

Comments
 (0)