-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
49 lines (41 loc) · 1.2 KB
/
Copy pathsetup.py
File metadata and controls
49 lines (41 loc) · 1.2 KB
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
43
44
45
46
47
48
49
import shutil
from setuptools import setup
if shutil.which("g++") is not None:
from pathlib import Path
from Cython.Build import cythonize
from setuptools.extension import Extension
pyx_files = Path("flask_inputfilter").rglob("*.pyx")
pyx_modules = [".".join(path.with_suffix("").parts) for path in pyx_files]
ext_modules = cythonize(
module_list=[
Extension(
name=module,
sources=[str(Path(*module.split(".")).with_suffix(".pyx"))],
extra_compile_args=["-std=c++11"],
language="c++",
)
for module in pyx_modules
],
language_level=3,
compiler_directives={
"binding": True,
"boundscheck": False,
"cdivision": True,
"embedsignature": True,
"infer_types": True,
"initializedcheck": False,
"linetrace": False,
"profile": False,
"wraparound": False,
},
)
options = {
"build_ext": {"include_dirs": ["flask_inputfilter/include"]},
}
else:
ext_modules = []
options = {}
setup(
ext_modules=ext_modules,
options=options,
)