-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
64 lines (51 loc) · 1.97 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
#!/usr/bin/env python3
#!/usr/bin/env python
import os
from setuptools import setup
try: # pip >= 10
from pip._internal.req import parse_requirements
except ImportError: # pip <= 9.0.3
from pip.req import parse_requirements
from setuptools.command.install import install
# Hackishly override of the install method
class InstallReqs(install):
def run(self):
print(" ********************** ")
print(" ** Installing PyRSM_Lite ** ")
print(" ********************** ")
os.system('pip install -r requirements.txt')
install.run(self)
def resource(*args):
return os.path.join(os.path.abspath(os.path.join(__file__, os.pardir)),
*args)
# parse_requirements() returns generator of pip.req.InstallRequirement objects
reqs = parse_requirements(resource('requirements.txt'), session=False)
try:
reqs = [str(ir.req) for ir in reqs]
except:
reqs = [str(ir.requirement) for ir in reqs]
with open(resource('README.md')) as readme_file:
README = readme_file.read()
setup(
name='PyRSM_Lite',
version=0.4,
description='Package for exoplanet detection and characterization via the RSM map algorithm (optimal parametrization via auto-RSM framework)',
long_description=README,
license='MIT',
author='Carl-Henrik Dahlqvist',
author_email='[email protected]',
url='https://github.com/chdahlqvist/RSMmap',
cmdclass={'install': InstallReqs},
packages=['PyRSM_Lite'],
install_requires=reqs,
zip_safe=False,
classifiers=['Intended Audience :: Science/Research',
'License :: OSI Approved :: MIT License',
'Operating System :: MacOS :: MacOS X',
'Operating System :: POSIX :: Linux',
'Natural Language :: English',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Topic :: Scientific/Engineering :: Astronomy'
]
)