-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
33 lines (25 loc) · 790 Bytes
/
Copy pathsetup.py
File metadata and controls
33 lines (25 loc) · 790 Bytes
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
import glob
import pathlib
from distutils.core import setup, Extension
from Cython.Build import cythonize
def create_ext():
for p in glob.iglob('noise/cynoise/**/*pyx', recursive=True):
path = pathlib.Path(p)
name = path.name
posix_path = path.as_posix()
parents = posix_path.split('/')[:-1]
yield Extension(
f'{".".join(parents)}.{name.split(".")[0]}',
[f'{"/".join(parents)}/{name}'],
define_macros=[("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION")]
)
extensions = [ext for ext in create_ext()]
setup(
ext_modules=cythonize(
extensions,
compiler_directives={
'profile': False,
'language_level': '3'
}
)
)