forked from claws/aioprometheus
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
62 lines (51 loc) · 1.88 KB
/
setup.py
File metadata and controls
62 lines (51 loc) · 1.88 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
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', 'aioprometheus', '__init__.py')
with open(init_file, 'r') as f:
module_content = f.read()
match = regexp.match(module_content)
if match:
version = match.group(1)
else:
raise RuntimeError(
'Cannot find __version__ in {}'.format(init_file))
with open('README.rst', 'r') as f:
readme = f.read()
def parse_requirements(filename):
''' Load requirements from a pip requirements file '''
with open(filename, 'r') as fd:
lines = []
for line in fd:
line = line.strip()
if line and not line.startswith("#"):
lines.append(line)
return lines
requirements = parse_requirements('requirements.txt')
if __name__ == "__main__":
setup(
name="aioprometheus",
version=version,
author="Chris Laws",
author_email="clawsicus@gmail.com",
description="A Prometheus Python client library for asyncio-based applications",
long_description=readme,
license="MIT",
keywords=["prometheus", "monitoring", "metrics"],
url="https://github.com/claws/aioprometheus",
package_dir={'': 'src'},
packages=find_packages('src'),
install_requires=requirements,
extras_require={
"aiohttp": ["aiohttp>=3.3.2"],
"binary": ["prometheus-metrics-proto>=18.1.1"],
},
classifiers=[
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3.6",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: System :: Monitoring"])