diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..6ee2426f --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,17 @@ +# Changelog + +## v2.0.0 - Jan 20, 2020 + +* Added support for newer Django and Python versions +* Added an extensibility that applications to add their own labels to middleware (request/response) metrics +* Allow overriding and setting custom bucket values for request/response latency histogram metric +* Internal improvements: + * use tox + * Use pytest + * use Black + * Automate pre-releases on every commit ot master + * Fix flaky tests. + +## v1.1.0 - Sep 28, 2019 + +* maintenance release that updates this library to support recent and supported version of python & Django \ No newline at end of file diff --git a/django_prometheus/__init__.py b/django_prometheus/__init__.py index b4469007..b219f519 100644 --- a/django_prometheus/__init__.py +++ b/django_prometheus/__init__.py @@ -10,7 +10,7 @@ __all__ = ["middleware", "models", "pip_prometheus"] -__version__ = "2.0.0.dev" +__version__ = "2.0.0" # Import pip_prometheus to export the pip metrics automatically. try: diff --git a/setup.py b/setup.py index cf3ecc70..aa71df97 100644 --- a/setup.py +++ b/setup.py @@ -1,41 +1,37 @@ import re from setuptools import find_packages, setup -LONG_DESCRIPTION = """Django-Prometheus +with open("README.md") as fl: + LONG_DESCRIPTION = fl.read() -This library contains code to expose some monitoring metrics relevant -to Django internals so they can be monitored by Prometheus.io. - -See https://github.com/korfuri/django-prometheus for usage -instructions. -""" def get_version(): - version_file = open('django_prometheus/__init__.py', 'r').read() - version_match = re.search(r'^__version__ = [\'"]([^\'"]*)[\'"]', version_file, re.MULTILINE) + version_file = open("django_prometheus/__init__.py", "r").read() + version_match = re.search( + r'^__version__ = [\'"]([^\'"]*)[\'"]', version_file, re.MULTILINE + ) if version_match: return version_match.group(1) - raise RuntimeError('Unable to find version string.') + raise RuntimeError("Unable to find version string.") + setup( name="django-prometheus", version=get_version(), author="Uriel Corfa", author_email="uriel@corfa.fr", - description=( - "Django middlewares to monitor your application with Prometheus.io."), + description=("Django middlewares to monitor your application with Prometheus.io."), license="Apache", keywords="django monitoring prometheus", url="http://github.com/korfuri/django-prometheus", - packages=find_packages(), + packages=find_packages(exclude=["tests",]), test_suite="django_prometheus.tests", long_description=LONG_DESCRIPTION, - tests_require=['pytest', 'pytest-django'], + long_description_content_type="text/markdown", + tests_require=["pytest", "pytest-django"], setup_requires=["pytest-runner"], options={"bdist_wheel": {"universal": "1"}}, - install_requires=[ - "prometheus-client>=0.7", - ], + install_requires=["prometheus-client>=0.7",], classifiers=[ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", diff --git a/tox.ini b/tox.ini index a08b7cde..ee8fb8fc 100644 --- a/tox.ini +++ b/tox.ini @@ -11,18 +11,18 @@ deps = -rrequirements.txt skip_missing_interpreters=true -changedir = +changedir = end2end: {toxinidir}/django_prometheus/tests/end2end setenv = end2end: PYTHONPATH = {toxinidir} - end2end: DJANGO_SETTINGS_MODULE=testapp.settings + end2end: DJANGO_SETTINGS_MODULE=testapp.settings commands = end2end: coverage run --source=django_prometheus -m pytest testapp/ unittests: coverage run --source=django_prometheus setup.py test unittests: python setup.py sdist bdist_wheel [testenv:py37-lint] -deps = +deps = black flake8 isort