File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55
66from Cython .Build import cythonize
77from setuptools import Command , Extension , setup
8+ from setuptools .command import build_ext
89
910
1011BASEDIR = 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
7279if ((FLAG_COVERAGE in sys .argv or os .environ .get ('CYTHON_COVERAGE' , None ))
7380 and cythonize ):
@@ -99,7 +106,7 @@ def run(self):
99106 )
100107
101108setup (
102- cmdclass = {'clean_cython' : CleanCython },
109+ cmdclass = {'clean_cython' : CleanCython , 'build_ext' : BuildExt },
103110 ext_modules = ext_modules ,
104111 options = SETUP_OPTIONS ,
105112)
You can’t perform that action at this time.
0 commit comments