1{ lib
2, buildPythonPackage
3, pythonOlder
4, fetchFromGitHub
5, prometheus-client
6, pytest-django
7, pytestCheckHook
8}:
9
10buildPythonPackage rec {
11 pname = "django-prometheus";
12 version = "2.2.0";
13 format = "setuptools";
14 disabled = pythonOlder "3.6";
15
16 src = fetchFromGitHub {
17 owner = "korfuri";
18 repo = pname;
19 rev = "v${version}";
20 hash = "sha256-NE0zHnGGSrtkBLrSyBcQuyGrSfSQbdpevokg3YZhwDw=";
21 };
22
23 patches = [
24 ./drop-untestable-database-backends.patch
25 ];
26
27 postPatch = ''
28 substituteInPlace setup.py \
29 --replace '"pytest-runner"' ""
30 '';
31
32 propagatedBuildInputs = [
33 prometheus-client
34 ];
35
36 pythonImportsCheck = [
37 "django_prometheus"
38 ];
39
40 checkInputs = [
41 pytest-django
42 pytestCheckHook
43 ];
44
45 meta = with lib; {
46 description = "Django middlewares to monitor your application with Prometheus.io";
47 homepage = "https://github.com/korfuri/django-prometheus";
48 license = licenses.asl20;
49 maintainers = with maintainers; [ hexa ];
50 };
51}