2015-08-31 16:31:38 +03:00
|
|
|
"""`Dependency injector` setup script."""
|
2015-01-04 16:54:25 +03:00
|
|
|
|
2016-11-02 18:21:40 +03:00
|
|
|
import os
|
2015-10-23 15:20:25 +03:00
|
|
|
|
2024-11-10 08:01:30 +03:00
|
|
|
from Cython.Build import cythonize
|
|
|
|
from Cython.Compiler import Options
|
|
|
|
from setuptools import Extension, setup
|
2015-01-04 16:54:25 +03:00
|
|
|
|
2024-11-10 08:01:30 +03:00
|
|
|
debug = os.environ.get("DEPENDENCY_INJECTOR_DEBUG_MODE") == "1"
|
|
|
|
defined_macros = []
|
|
|
|
compiler_directives = {
|
|
|
|
"language_level": 3,
|
|
|
|
"profile": debug,
|
|
|
|
"linetrace": debug,
|
|
|
|
}
|
|
|
|
Options.annotate = debug
|
2015-01-04 16:54:25 +03:00
|
|
|
|
2016-11-03 01:06:14 +03:00
|
|
|
# Adding debug options:
|
2024-11-10 08:01:30 +03:00
|
|
|
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,
|
|
|
|
),
|
|
|
|
)
|