1{ 2 lib, 3 buildPythonPackage, 4 fetchFromGitHub, 5 setuptools, 6 prometheus-client, 7 pytest-django, 8 pytestCheckHook, 9}: 10 11buildPythonPackage rec { 12 pname = "django-prometheus"; 13 version = "2.4.1"; 14 pyproject = true; 15 16 src = fetchFromGitHub { 17 owner = "django-commons"; 18 repo = "django-prometheus"; 19 tag = "v${version}"; 20 hash = "sha256-Bf1JSh9ibiPOa252IPld1FvHTPbCsB/amtlQdRQwoWY="; 21 }; 22 23 postPatch = '' 24 substituteInPlace pyproject.toml \ 25 --replace-fail "setuptools >= 67.7.2, < 72.0.0" setuptools 26 27 substituteInPlace setup.py \ 28 --replace-fail '"pytest-runner"' "" 29 ''; 30 31 build-system = [ setuptools ]; 32 33 dependencies = [ prometheus-client ]; 34 35 pythonImportsCheck = [ "django_prometheus" ]; 36 37 nativeCheckInputs = [ 38 pytest-django 39 pytestCheckHook 40 ]; 41 42 meta = with lib; { 43 changelog = "https://github.com/django-commons/django-prometheus/releases/tag/v${version}"; 44 description = "Django middlewares to monitor your application with Prometheus.io"; 45 homepage = "https://github.com/django-commons/django-prometheus"; 46 license = licenses.asl20; 47 maintainers = with maintainers; [ hexa ]; 48 }; 49}