forked from bluephlavio/eph
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
82 lines (68 loc) · 2.05 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
71
72
73
74
75
76
77
78
79
80
81
82
from setuptools import setup, find_packages
from setuptools.command.install import install
from setuptools.command.develop import develop
from shutil import copy2
import os
try:
import configparser as configparser
except ImportError:
import ConfigParser as configparser
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, 'README.rst')) as f:
long_description = f.read()
parser = configparser.ConfigParser()
parser.read('setup.cfg')
meta = dict(parser.items('metadata'))
def install_config():
dst = os.path.abspath(os.path.expanduser('~/.ephrc'))
if not os.path.isfile(dst):
src = os.path.abspath(os.path.join(here, 'eph/eph.cfg'))
copy2(src, dst)
class CustomInstall(install):
def run(self):
install_config()
install.run(self)
class CustomDevelop(develop):
def run(self):
install_config()
develop.run(self)
setup(
name=meta['package'],
version=meta['release'],
description=meta['description'],
long_description=long_description,
author=meta['author'],
author_email=meta['author_email'],
license=meta['license'],
url=meta['url'],
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
'Operating System :: OS Independent',
'Topic :: Scientific/Engineering :: Astronomy',
'Topic :: Scientific/Engineering :: Physics',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
],
packages=find_packages(),
install_requires=[
'six',
'requests',
'astropy',
],
include_package_data=True,
entry_points={
'console_scripts': [
'eph=eph.cli:main',
],
},
cmdclass={
'develop': CustomDevelop,
'install': CustomInstall,
},
setup_requires=['pytest-runner', ],
tests_require=['pytest', ],
)