Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cython==3.0.11
cython==3.1.0
setuptools
pytest
pytest-asyncio
Expand Down
9 changes: 9 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
from setuptools import Extension, setup

debug = os.environ.get("DEPENDENCY_INJECTOR_DEBUG_MODE") == "1"
limited_api = os.environ.get("DEPENDENCY_INJECTOR_LIMITED_API") == "1"
defined_macros = []
options = {}
compiler_directives = {
"language_level": 3,
"profile": debug,
Expand All @@ -17,6 +19,7 @@

# Adding debug options:
if debug:
limited_api = False # line tracing is not part of the Limited API
defined_macros.extend(
[
("CYTHON_TRACE", "1"),
Expand All @@ -25,14 +28,20 @@
]
)

if limited_api:
options.setdefault("bdist_wheel", {})
options["bdist_wheel"]["py_limited_api"] = "cp38"
defined_macros.append(("Py_LIMITED_API", 0x03080000))

setup(
options=options,
ext_modules=cythonize(
[
Extension(
"*",
["src/**/*.pyx"],
define_macros=defined_macros,
py_limited_api=limited_api,
),
],
annotate=debug,
Expand Down