-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
34 lines (28 loc) · 914 Bytes
/
Copy pathsetup.py
File metadata and controls
34 lines (28 loc) · 914 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
34
from setuptools import setup, Extension
import numpy as np
def get_extensions():
"""Get extension modules, returns empty list if Cython not available."""
try:
from Cython.Build import cythonize
extensions = [
Extension(
"fpcs.fpcs_cy",
sources=["src/fpcs/fpcs_cy.pyx"],
include_dirs=[np.get_include()],
)
]
return cythonize(
extensions,
compiler_directives={
"language_level": "3",
"boundscheck": False,
"wraparound": False,
"cdivision": True,
"initializedcheck": False,
"nonecheck": False,
},
)
except ImportError:
print("WARNING: Cython not available. Using pure Python implementation.")
return []
setup(ext_modules=get_extensions())