Files
nixpkgs/pkgs/development/python-modules/django-prometheus/default.nix
T
Ihar Hrachyshka 567e8dfd8e treewide: clean up 'meta = with' pattern
This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.

Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
2025-12-10 18:09:49 +01:00

50 lines
1.1 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
setuptools,
prometheus-client,
pytest-django,
pytestCheckHook,
}:
buildPythonPackage rec {
pname = "django-prometheus";
version = "2.4.1";
pyproject = true;
src = fetchFromGitHub {
owner = "django-commons";
repo = "django-prometheus";
tag = "v${version}";
hash = "sha256-Bf1JSh9ibiPOa252IPld1FvHTPbCsB/amtlQdRQwoWY=";
};
postPatch = ''
substituteInPlace pyproject.toml \
--replace-fail "setuptools >= 67.7.2, < 72.0.0" setuptools
substituteInPlace setup.py \
--replace-fail '"pytest-runner"' ""
'';
build-system = [ setuptools ];
dependencies = [ prometheus-client ];
pythonImportsCheck = [ "django_prometheus" ];
nativeCheckInputs = [
pytest-django
pytestCheckHook
];
meta = {
changelog = "https://github.com/django-commons/django-prometheus/releases/tag/v${version}";
description = "Django middlewares to monitor your application with Prometheus.io";
homepage = "https://github.com/django-commons/django-prometheus";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ hexa ];
};
}