-
Notifications
You must be signed in to change notification settings - Fork 3
/
setup.py
53 lines (45 loc) · 1.28 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
50
51
52
53
# pylint: disable=invalid-name, line-too-long
"""setup.py for VAM whittaker core"""
from setuptools import setup, Extension, find_packages
import numpy
USE_CYTHON = True # "auto"
if USE_CYTHON:
try:
from Cython.Distutils import build_ext
if USE_CYTHON == "auto":
USE_CYTHON = True
except ImportError:
if USE_CYTHON == "auto":
USE_CYTHON = False
else:
raise
cmdclass = {}
ext_modules = []
if USE_CYTHON:
ext_modules += [
Extension(
"vam.whittaker._whit",
["vam/whittaker/_whittaker.pyx"],
extra_compile_args=["-O3", "-ffast-math"],
)
]
cmdclass.update({"build_ext": build_ext})
else:
ext_modules += [
Extension(
"vam.whittaker._whit",
["vam/whittaker/_whittaker.c"],
extra_compile_args=["-O3", "-ffast-math"],
)
]
setup(
include_dirs=[numpy.get_include()],
cmdclass=cmdclass,
packages=["vam", "vam.whittaker", "vam.whittaker._version"],
package_data={"vam.whittaker": ["*.pyx", "*.c"]},
ext_modules=ext_modules,
setup_requires=["pytest-runner"],
tests_require=["pytest"],
install_requires=["numpy>=1.15.1", 'mock;python_version<"3.0"'],
python_requires=">=3, <4",
)