Skip to content

Commit 6629b9e

Browse files
committed
Limit ABI3 builds to CPython only
1 parent 29b9c09 commit 6629b9e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

setup.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
"""`Dependency injector` setup script."""
22

33
import os
4+
import sys
45

56
from Cython.Build import cythonize
67
from Cython.Compiler import Options
78
from setuptools import Extension, setup
89

910
debug = os.environ.get("DEPENDENCY_INJECTOR_DEBUG_MODE") == "1"
10-
limited_api = os.environ.get("DEPENDENCY_INJECTOR_LIMITED_API") == "1"
11+
limited_api = (
12+
os.environ.get("DEPENDENCY_INJECTOR_LIMITED_API") == "1"
13+
and sys.implementation.name == "cpython"
14+
)
1115
defined_macros = []
1216
options = {}
1317
compiler_directives = {
@@ -31,7 +35,7 @@
3135
if limited_api:
3236
options.setdefault("bdist_wheel", {})
3337
options["bdist_wheel"]["py_limited_api"] = "cp38"
34-
defined_macros.append(("Py_LIMITED_API", 0x03080000))
38+
defined_macros.append(("Py_LIMITED_API", "0x03080000"))
3539

3640
setup(
3741
options=options,

0 commit comments

Comments
 (0)