opnsense-prom-exporter/setup.py

51 lines
1.6 KiB
Python
Raw Normal View History

import pathlib
2023-09-01 13:27:55 +02:00
from urllib.parse import urlparse
from setuptools import find_packages, setup
2023-09-01 17:00:58 +02:00
version = "0.0.0"
HERE = pathlib.Path(__file__).parent
2023-09-01 13:27:55 +02:00
def parse_requirements(file):
required = []
with open(file) as f:
for req in f.read().splitlines():
if req.strip().startswith("git"):
req = urlparse(req.strip()).fragment.split("=")[1]
if req.strip().startswith("-e"):
req = urlparse(req.strip().split()[1]).fragment.split("=")[1]
if not req.strip().startswith("#") and not req.strip().startswith("--"):
required.append(req)
return required
requires = parse_requirements("requirements.txt")
tests_requires = parse_requirements("requirements.tests.txt")
README = (HERE / "README.md").read_text()
2023-09-01 13:27:55 +02:00
setup(
name="opnsense-prom-exporter",
version=version,
description="OPNSense Prometheus exporter",
long_description=README,
long_description_content_type="text/markdown",
2023-09-01 13:27:55 +02:00
author="Pierre Verkest",
author_email="pierreverkest84@gmail.com",
2023-09-01 13:40:46 +02:00
url="https://gitlab.com/micro-entreprise/opnsense-prom-exporter",
license="Apache-2.0",
classifiers=[
"Development Status :: 4 - Beta",
"Programming Language :: Python :: 3",
"License :: OSI Approved :: Apache Software License",
],
2023-09-01 13:27:55 +02:00
namespace_packages=["opnsense_exporter"],
packages=find_packages(exclude=["ez_setup", "examples", "tests"]),
install_requires=requires,
tests_require=requires + tests_requires,
entry_points="""
[console_scripts]
opnsense-exporter=opnsense_exporter.server:run
""",
)