mirror of
https://github.com/SebastianWendel/nixpkgs.git
synced 2024-10-01 17:40:20 +02:00
python3Packages.django-prometheus: init at 2.1.0
This commit is contained in:
parent
b551e68ad4
commit
1091005449
|
@ -0,0 +1,52 @@
|
|||
{ lib
|
||||
, buildPythonPackage
|
||||
, pythonOlder
|
||||
, fetchFromGitHub
|
||||
, prometheus-client
|
||||
, psycopg2
|
||||
, pytest-django
|
||||
, pytestCheckHook
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "django-prometheus";
|
||||
version = "2.1.0";
|
||||
format = "setuptools";
|
||||
disabled = pythonOlder "3.6";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "korfuri";
|
||||
repo = pname;
|
||||
rev = version;
|
||||
sha256 = "1y1cmycc545xrys41jk8kia36hwnkwhkw26mlpfdjgb63vq30x1d";
|
||||
};
|
||||
|
||||
patches = [
|
||||
./drop-untestable-database-backends.patch
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace setup.py \
|
||||
--replace '"pytest-runner"' ""
|
||||
'';
|
||||
|
||||
propagatedBuildInputs = [
|
||||
prometheus-client
|
||||
];
|
||||
|
||||
pythonImportsCheck = [
|
||||
"django_prometheus"
|
||||
];
|
||||
|
||||
checkInputs = [
|
||||
pytest-django
|
||||
pytestCheckHook
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
description = "Django middlewares to monitor your application with Prometheus.io";
|
||||
homepage = "https://github.com/korfuri/django-prometheus";
|
||||
license = licenses.asl20;
|
||||
maintainers = with maintainers; [ hexa ];
|
||||
};
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
diff --git a/django_prometheus/tests/end2end/testapp/settings.py b/django_prometheus/tests/end2end/testapp/settings.py
|
||||
index 0630721..bd2190a 100644
|
||||
--- a/django_prometheus/tests/end2end/testapp/settings.py
|
||||
+++ b/django_prometheus/tests/end2end/testapp/settings.py
|
||||
@@ -53,33 +53,6 @@ DATABASES = {
|
||||
"ENGINE": "django_prometheus.db.backends.sqlite3",
|
||||
"NAME": "db.sqlite3",
|
||||
},
|
||||
- # Comment this to not test django_prometheus.db.backends.postgres.
|
||||
- "postgresql": {
|
||||
- "ENGINE": "django_prometheus.db.backends.postgresql",
|
||||
- "NAME": "postgres",
|
||||
- "USER": "postgres",
|
||||
- "PASSWORD": "",
|
||||
- "HOST": "localhost",
|
||||
- "PORT": "5432",
|
||||
- },
|
||||
- # Comment this to not test django_prometheus.db.backends.postgis.
|
||||
- "postgis": {
|
||||
- "ENGINE": "django_prometheus.db.backends.postgis",
|
||||
- "NAME": "postgis",
|
||||
- "USER": "postgres",
|
||||
- "PASSWORD": "",
|
||||
- "HOST": "localhost",
|
||||
- "PORT": "5432",
|
||||
- },
|
||||
- # Comment this to not test django_prometheus.db.backends.mysql.
|
||||
- "mysql": {
|
||||
- "ENGINE": "django_prometheus.db.backends.mysql",
|
||||
- "NAME": "django_prometheus_1",
|
||||
- "USER": "travis",
|
||||
- "PASSWORD": "",
|
||||
- "HOST": "localhost",
|
||||
- "PORT": "3306",
|
||||
- },
|
||||
# The following databases are used by test_db.py only
|
||||
"test_db_1": {
|
||||
"ENGINE": "django_prometheus.db.backends.sqlite3",
|
|
@ -2169,6 +2169,8 @@ in {
|
|||
|
||||
django-postgresql-netfields = callPackage ../development/python-modules/django-postgresql-netfields { };
|
||||
|
||||
django-prometheus = callPackage ../development/python-modules/django-prometheus { };
|
||||
|
||||
django-q = callPackage ../development/python-modules/django-q { };
|
||||
|
||||
djangoql = callPackage ../development/python-modules/djangoql { };
|
||||
|
|
Loading…
Reference in a new issue