Skip to content

Commit

Permalink
Merge pull request #203 from asherf/dups
Browse files Browse the repository at this point in the history
Prepare 2.0.0 release.
  • Loading branch information
asherf authored Jan 20, 2020
2 parents 5749afa + 5de3d05 commit f55b7c1
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 21 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion django_prometheus/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
30 changes: 13 additions & 17 deletions setup.py
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
6 changes: 3 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f55b7c1

Please sign in to comment.