-
Notifications
You must be signed in to change notification settings - Fork 29
/
setup.py
49 lines (42 loc) · 1.31 KB
/
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
43
44
45
46
47
48
49
#!/usr/bin/env python
import pathlib
import platform
from Cython.Build import cythonize
from setuptools import Extension, find_packages, setup
def read_version():
root_path = pathlib.Path(__file__).parent
version_path = root_path / "supriya" / "_version.py"
with version_path.open() as file_pointer:
file_contents = file_pointer.read()
local_dict = {}
exec(file_contents, None, local_dict)
return local_dict["__version__"]
extensions = [
Extension(
"supriya.utils._intervals",
language="c",
sources=["supriya/utils/_intervals.pyx"],
)
]
if platform.system() != "Windows":
extensions.append(
Extension(
"supriya.contexts.shm",
include_dirs=[
"vendor",
"vendor/TLSF-2.4.6/src",
"vendor/supercollider/common",
],
language="c++",
libraries=["rt"] if platform.system() == "Linux" else [],
sources=["supriya/contexts/shm.pyx"],
)
)
if __name__ == "__main__":
setup(
ext_modules=cythonize(extensions),
packages=find_packages(include=["supriya", "supriya.*"])
+ ["supriya.assets.audio", "supriya.assets.audio.birds"],
version=read_version(),
package_data={"supriya": ["py.typed"]},
)