-
Notifications
You must be signed in to change notification settings - Fork 59
Expand file tree
/
Copy pathbuild.py
More file actions
25 lines (20 loc) · 724 Bytes
/
build.py
File metadata and controls
25 lines (20 loc) · 724 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
from setuptools import Extension
def build(setup_kwargs):
try:
import numpy as np
from Cython.Build import cythonize
cyfuncs_ext = Extension(name="pyphysim.c_extensions.misc_c",
sources=["pyphysim/util/misc_c.pyx"],
include_dirs=[np.get_include()])
EXTENSIONS = [cyfuncs_ext]
setup_kwargs.update({
'ext_modules':
cythonize(EXTENSIONS, language_level=3),
'zip_safe':
False,
})
except ModuleNotFoundError:
import warnings
warnings.warn(
"numpy and cython must be installed to compyle cython extensions in pyphysim"
)