nixpkgs/pkgs/development/python-modules/rules/default.nix
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

49 lines
982 B
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
# build-system
setuptools,
# tests
django,
djangorestframework,
python,
}:
buildPythonPackage rec {
pname = "rules";
version = "3.5.0";
pyproject = true;
src = fetchFromGitHub {
owner = "dfunckt";
repo = "django-rules";
tag = "v${version}";
hash = "sha256-8Kay2b2uwaI/ml/cPpcj9svoDQI0ptV8tyGeZ76SgZw=";
};
build-system = [ setuptools ];
pythonImportsCheck = [ "rules" ];
nativeCheckInputs = [
django
djangorestframework
];
checkPhase = ''
runHook preCheck
${python.interpreter} tests/manage.py test testsuite -v2
runHook postCheck
'';
meta = {
description = "Awesome Django authorization, without the database";
homepage = "https://github.com/dfunckt/django-rules";
changelog = "https://github.com/dfunckt/django-rules/blob/${src.rev}/CHANGELOG.md";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ hexa ];
};
}