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