-
Notifications
You must be signed in to change notification settings - Fork 44
/
Copy pathsetup.py
70 lines (61 loc) · 1.82 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
from setuptools import setup, find_packages, Extension
import numpy, sys
import re
USE_C_KEPLER_MODULE = 1
if "--disable-cython" in sys.argv:
sys.argv.remove("--disable-cython")
USE_C_KEPLER_MODULE = 0
else:
try:
from Cython.Build import cythonize
except:
print("Error: Importing cython build environment failed")
USE_C_KEPLER_MODULE = 0
# auto-updating version code stolen from RadVel
def get_property(prop, project):
result = re.search(
r'{}\s*=\s*[\'"]([^\'"]*)[\'"]'.format(prop),
open(project + "/__init__.py").read(),
)
return result.group(1)
def get_requires():
reqs = []
for line in open("requirements.txt", "r").readlines():
reqs.append(line)
return reqs
def get_extensions():
extensions = []
if USE_C_KEPLER_MODULE:
extensions = cythonize(
[
Extension(
"orbitize._kepler",
["orbitize/_kepler.pyx"],
include_dirs=[numpy.get_include()],
)
]
)
return extensions
setup(
name="orbitize",
version=get_property("__version__", "orbitize"),
description="orbitize! Turns imaging data into orbits",
url="https://github.com/sblunt/orbitize",
author="",
author_email="",
license="BSD",
packages=find_packages(),
package_data={"": ["kernels/*.cu"]},
ext_modules=get_extensions(),
include_dirs=[numpy.get_include()],
include_package_data=True,
zip_safe=False,
classifiers=[
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering :: Astronomy",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python :: 3.6",
],
keywords="Orbits Astronomy Astrometry",
install_requires=get_requires(),
)