-
Notifications
You must be signed in to change notification settings - Fork 101
/
setup.py
50 lines (40 loc) · 1.13 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
#! /usr/bin/env python
import sys
try:
import numpy as np
except ImportError:
print("\nPlease install numpy before building cesium.\n")
sys.exit(1)
try:
from Cython.Build import cythonize
except ImportError:
print("\nPlease install Cython before building cesium.\n")
sys.exit(1)
try:
import setuptools_scm # noqa: F401
except ImportError:
print("\nPlease install setuptools_scm before building cesium.")
sys.exit(1)
from setuptools import Extension, find_namespace_packages, setup
from setuptools.command.build_ext import build_ext
def extensions():
np_inc = np.get_include()
cython_exts = cythonize(
Extension(
"cesium.features._lomb_scargle",
sources=["cesium/features/_lomb_scargle.pyx"],
include_dirs=[np_inc],
),
include_path=["cesium/features"],
)
return cython_exts
if __name__ == "__main__":
metadata = dict(
name="cesium",
packages=find_namespace_packages(
include=["cesium*"],
),
cmdclass={"build_ext": build_ext},
ext_modules=extensions(),
)
setup(**metadata)