-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
executable file
·110 lines (90 loc) · 2.96 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
from setuptools import setup
from setuptools.command.test import test as testcommand
import os
import shutil
import sys
# import pyops
# from multiprocessing import util
root_dir = os.path.dirname(os.path.realpath(__file__))
with open('requirements.txt') as f:
required = f.read().splitlines()
with open('pyops/__init__.py') as f:
for line in f.readlines():
if line.startswith('__version__'):
version = line.split('=')[-1].strip('\n \'')
readme = open('README.rst').read()
history = open('HISTORY.rst').read().replace('.. :changelog:', '')
authors = open('AUTHORS.rst').read()
contributing = open('CONTRIBUTING.rst').read()
LONG_DESCRIPTION = """
pyops is a python library for the manipulation, processing and plotting of
the input and output files of ESA Experiment Planning Software (EPS).
- Free software: BSD license
- Documentation: http://pyops.rtfd.org.
**Modules**
- **draw** makes pretty orbit graphics
- **events** provides a series of time/date utilities
- **maps** does things with maps and images
- **orbit** processes mission analysis orbit files
- **read** reads EPS/MAPPS output into useable dataframes and/or arrays
- **utils** more utilities ...
"""
class PyTest(testcommand):
def finalize_options(self):
testcommand.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):
import pytest
errcode = pytest.main(self.test_args)
sys.exit(errcode)
class Tox(testcommand):
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 tox
errcode = tox.cmdline(self.test_args)
sys.exit(errcode)
def cleanup():
cleanuplist = ('build', 'dist', 'pyops.egg-info')
for file in cleanuplist:
try:
shutil.rmtree(os.path.join(root_dir, file))
except OSError:
pass
if sys.argv[-1] == 'publish':
os.system('python setup.py sdist upload')
sys.exit()
try:
setup(
name='pyops',
version=version,
description='A python library for handling EPS output.',
long_description=LONG_DESCRIPTION,
author='Jonathan McAuliffe',
author_email='[email protected]',
url='https://github.com/johnnycakes79/pyops',
packages=['pyops', 'test'],
package_data={'test': ['data/*.out']},
include_package_data=True,
# cmdclass={'test': Tox},
cmdclass={'test': PyTest},
test_suite='test',
# tests_require=['tox'],
tests_require=['pytest'],
install_requires=required,
license="BSD",
zip_safe=False,
keywords='pyops',
extras_require={
'testing': ['pytest'],
}
)
finally:
cleanup()