Skip to content

Commit 8bf9ed0

Browse files
authored
Update Cython to v3.1 (#887)
1 parent dbf86e4 commit 8bf9ed0

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

requirements-dev.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cython==3.0.11
1+
cython==3.1.0
22
setuptools
33
pytest
44
pytest-asyncio

setup.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
from setuptools import Extension, setup
88

99
debug = os.environ.get("DEPENDENCY_INJECTOR_DEBUG_MODE") == "1"
10+
limited_api = os.environ.get("DEPENDENCY_INJECTOR_LIMITED_API") == "1"
1011
defined_macros = []
12+
options = {}
1113
compiler_directives = {
1214
"language_level": 3,
1315
"profile": debug,
@@ -17,6 +19,7 @@
1719

1820
# Adding debug options:
1921
if debug:
22+
limited_api = False # line tracing is not part of the Limited API
2023
defined_macros.extend(
2124
[
2225
("CYTHON_TRACE", "1"),
@@ -25,14 +28,20 @@
2528
]
2629
)
2730

31+
if limited_api:
32+
options.setdefault("bdist_wheel", {})
33+
options["bdist_wheel"]["py_limited_api"] = "cp38"
34+
defined_macros.append(("Py_LIMITED_API", 0x03080000))
2835

2936
setup(
37+
options=options,
3038
ext_modules=cythonize(
3139
[
3240
Extension(
3341
"*",
3442
["src/**/*.pyx"],
3543
define_macros=defined_macros,
44+
py_limited_api=limited_api,
3645
),
3746
],
3847
annotate=debug,

0 commit comments

Comments
 (0)