-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathsetup.py
More file actions
33 lines (28 loc) · 1014 Bytes
/
setup.py
File metadata and controls
33 lines (28 loc) · 1014 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
"""pentapy: A toolbox for pentadiagonal matrizes."""
import os
import numpy as np
from Cython.Build import cythonize
from setuptools import Extension, setup
# cython extensions
CY_MODULES = [
Extension(
name=f"pentapy.solver",
sources=[os.path.join("src", "pentapy", "solver.pyx")],
include_dirs=[np.get_include()],
define_macros=[("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION")],
)
]
compiler_directives = {}
if int(os.getenv("PENTAPY_CY_DOCS", "0")):
print(f"## pentapy setup: embed signatures for documentation")
compiler_directives["embedsignature"] = True
if int(os.getenv("PENTAPY_CY_COV", "0")):
print(f"## pentapy setup: enable line-trace for coverage")
compiler_directives["linetrace"] = True
options = {"compiler_directives": compiler_directives}
setup(
ext_modules=cythonize(CY_MODULES, **options),
package_data={"pentapy": ["*.pxd"]}, # include pxd files
include_package_data=False, # ignore other files
zip_safe=False,
)