-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathsetup.py
71 lines (61 loc) · 2.41 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
import os
import re
from setuptools import find_packages, setup
regexp = re.compile(r".*__version__ = [\'\"](.*?)[\'\"]", re.S)
init_file = os.path.join(
os.path.dirname(__file__), "src", "dump1090exporter", "__init__.py"
)
with open(init_file, "r") as f: # pylint: disable=unspecified-encoding
module_content = f.read()
match = regexp.match(module_content)
if match:
version = match.group(1)
else:
raise RuntimeError(f"Cannot find __version__ in {init_file}")
with open("README.md", "r") as f: # pylint: disable=unspecified-encoding
readme = f.read()
def parse_requirements(filename):
"""Load requirements from a pip requirements file"""
with open(filename, "r") as fd: # pylint: disable=unspecified-encoding
lines = []
for line in fd:
line = line.strip()
if line and not line.startswith("#"):
lines.append(line)
return lines
if __name__ == "__main__":
setup(
name="dump1090exporter",
version=version,
author="Chris Laws",
author_email="[email protected]",
description="A Prometheus metrics exporter for the dump1090 Mode S decoder for RTLSDR",
long_description_content_type="text/markdown",
long_description=readme,
license="MIT",
keywords=["prometheus", "monitoring", "metrics", "dump1090", "ADSB"],
url="https://github.com/claws/dump1090-exporter",
package_dir={"": "src"},
packages=find_packages("src"),
install_requires=parse_requirements("requirements.txt"),
extras_require={
"develop": parse_requirements("requirements.dev.txt"),
"uvloop": ["uvloop==0.16.0"],
},
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Topic :: System :: Monitoring",
],
entry_points={
"console_scripts": ["dump1090exporter = dump1090exporter.__main__:main"]
},
)