-
Notifications
You must be signed in to change notification settings - Fork 119
/
Copy pathsetup.py
91 lines (76 loc) · 2.98 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
#!/usr/bin/env python
from codecs import open # To use a consistent encoding
from os import path, system
import re
import sys
# Always prefer setuptools over distutils
from setuptools import find_packages, setup
from setuptools.command.test import test as TestCommand # noqa: N812
class PyTest(TestCommand):
user_options = [('pytest-args=', 'a', "Arguments to pass to pytest")]
def initialize_options(self):
TestCommand.initialize_options(self)
self.pytest_args = ''
def run_tests(self):
import shlex
import pytest # import here, cause outside the eggs aren't loaded
errno = pytest.main(shlex.split(self.pytest_args))
sys.exit(errno)
if sys.argv[-1] == 'publish':
system('python setup.py sdist upload')
sys.exit()
with open('iridiumtk/__init__.py', 'r') as fd:
contents = fd.read()
version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]',
contents, re.MULTILINE).group(1)
title = re.search(r'^__title__\s*=\s*[\'"]([^\'"]*)[\'"]',
contents, re.MULTILINE).group(1)
author = re.search(r'^__author__\s*=\s*[\'"]([^\'"]*)[\'"]',
contents, re.MULTILINE).group(1)
if not version:
raise RuntimeError('Cannot find version information')
if not title:
raise RuntimeError('Cannot find title information')
if not author:
raise RuntimeError('Cannot find author information')
here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(
name=title,
version=version,
description='iridiumtk', # TODO
long_description=long_description,
author=author,
author_email='[email protected]', # TODO
url='https://github.com/muccc/iridium-toolkit',
packages=find_packages(exclude=['9601', 'ambe_emu', 'nal-shout', 'rtl-sdr', 'tools', 'tracking']),
entry_points={
'console_scripts': [
'iridiumtk-graph-voc=iridiumtk.graph_voc:main',
'iridiumtk-graph-by-type=iridiumtk.graph_by_type:main',
'iridiumtk-bits-to-dfs=iridiumtk.bits_to_dfs:main',
'iridiumtk-rx-stats-hist=iridiumtk.rx_stats_hist:main',
'iridiumtk-reassembler=iridiumtk.reassembler:main',
],
},
package_data={'': ['LICENSE', 'README.md']},
zip_safe=False,
python_requires='>=3.6',
install_requires=[],
tests_require=['pytest'],
cmdclass={'test': PyTest},
keywords=[],
license='BSD',
classifiers=(
'Development Status :: 3 - Alpha',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
),
)