forked from 4n4nd/prometheus-api-client-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
46 lines (38 loc) · 1.43 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
"""Setup for Prometheus Api Client module."""
import os
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
def get_install_requires():
"""Get requirements from requirements.txt."""
with open("requirements.txt", "r") as requirements_file:
res = requirements_file.readlines()
return [req.split(" ", maxsplit=1)[0] for req in res if req]
def get_version():
"""Get package version."""
with open(os.path.join("prometheus_api_client", "__init__.py")) as f:
content = f.readlines()
for line in content:
if line.startswith("__version__ ="):
# dirty, remove trailing and leading chars
return line.split(" = ")[1][1:-2]
raise ValueError("No version identifier found")
VERSION = get_version()
setuptools.setup(
name="prometheus-api-client",
version=VERSION,
author="Anand Sanmukhani",
author_email="[email protected]",
description="A small python api to collect data from prometheus",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/AICoE/prometheus-api-client-python",
install_requires=get_install_requires(),
packages=setuptools.find_packages(),
tests_require=["httmock"],
classifiers=[
"Programming Language :: Python :: 3.6",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
)