Skip to content

Commit 7cdcb1d

Browse files
committed
exp: tentative fixup
1 parent adc3dff commit 7cdcb1d

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

setup.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
from Cython.Build import cythonize
77
from setuptools import Command, Extension, setup
8+
from setuptools.command import build_ext
89

910

1011
BASEDIR = os.path.abspath(os.path.dirname(__file__))
@@ -68,6 +69,12 @@ def run(self):
6869
else:
6970
print('clean: skipping file {!r}'.format(artifact))
7071

72+
class BuildExt(build_ext):
73+
def finalize_options(self) -> None:
74+
super().finalize_options()
75+
for ext in self.extensions:
76+
ext.py_limited_api = USE_PY_LIMITED_API
77+
7178

7279
if ((FLAG_COVERAGE in sys.argv or os.environ.get('CYTHON_COVERAGE', None))
7380
and cythonize):
@@ -99,7 +106,7 @@ def run(self):
99106
)
100107

101108
setup(
102-
cmdclass={'clean_cython': CleanCython},
109+
cmdclass={'clean_cython': CleanCython, 'build_ext': BuildExt},
103110
ext_modules=ext_modules,
104111
options=SETUP_OPTIONS,
105112
)

0 commit comments

Comments
 (0)