-
-
Notifications
You must be signed in to change notification settings - Fork 310
/
setup.py
42 lines (36 loc) · 894 Bytes
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
"""`Dependency injector` setup script."""
import os
from Cython.Build import cythonize
from Cython.Compiler import Options
from setuptools import Extension, setup
debug = os.environ.get("DEPENDENCY_INJECTOR_DEBUG_MODE") == "1"
defined_macros = []
compiler_directives = {
"language_level": 3,
"profile": debug,
"linetrace": debug,
}
Options.annotate = debug
# Adding debug options:
if debug:
defined_macros.extend(
[
("CYTHON_TRACE", "1"),
("CYTHON_TRACE_NOGIL", "1"),
("CYTHON_CLINE_IN_TRACEBACK", "1"),
]
)
setup(
ext_modules=cythonize(
[
Extension(
"*",
["src/**/*.pyx"],
define_macros=defined_macros,
),
],
annotate=debug,
show_all_warnings=True,
compiler_directives=compiler_directives,
),
)