forked from python-astrodynamics/spacetrack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
95 lines (76 loc) · 2.28 KB
/
setup.py
File metadata and controls
95 lines (76 loc) · 2.28 KB
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
83
84
85
86
87
88
89
90
91
92
93
94
95
# coding: utf-8
from __future__ import absolute_import, division, print_function
import re
import sys
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand # noqa
INIT_FILE = 'spacetrack/__init__.py'
init_data = open(INIT_FILE).read()
metadata = dict(re.findall("__([a-z]+)__ = '([^']+)'", init_data))
VERSION = metadata['version']
LICENSE = metadata['license']
DESCRIPTION = metadata['description']
AUTHOR = metadata['author']
EMAIL = metadata['email']
requires = [
'logbook>=0.12.3',
'ratelimiter>=1.2.0',
'represent>=1.4.0',
'requests',
'six',
]
extras_require = dict()
extras_require['test'] = [
'pytest>=3.0',
'responses',
]
extras_require['async:python_version>="3.5"'] = ['aiohttp~=2.0']
extras_require['test:python_version<"3.3"'] = ['mock']
extras_require['test:python_version>="3.5"'] = ['pytest-asyncio']
extras_require['docstest'] = [
'doc8',
'pyenchant',
'sphinx',
'sphinx_rtd_theme',
'sphinxcontrib-spelling',
]
extras_require['pep8test'] = [
'flake8',
'flake8-coding',
'flake8-future-import',
'pep8-naming',
]
class PyTest(TestCommand):
user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")]
def initialize_options(self):
TestCommand.initialize_options(self)
self.pytest_args = []
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):
# import here, cause outside the eggs aren't loaded
import pytest
errno = pytest.main(self.pytest_args)
sys.exit(errno)
setup(
name='spacetrack',
version=VERSION,
description=DESCRIPTION,
long_description=open('README.rst').read(),
author=AUTHOR,
author_email=EMAIL,
url='https://github.com/python-astrodynamics/spacetrack',
packages=find_packages(exclude=['tests']),
cmdclass={'test': PyTest},
classifiers=[
'Development Status :: 4 - Beta',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
],
license=LICENSE,
install_requires=requires,
extras_require=extras_require,
tests_require=extras_require['test'])