depot/third_party/nixpkgs/pkgs/development/python-modules/django-currentuser/default.nix
Default email e7ec2969af Project import generated by Copybara.
GitOrigin-RevId: 9b19f5e77dd906cb52dade0b7bd280339d2a1f3d
2024-01-13 09:15:51 +01:00

51 lines
1.1 KiB
Nix

{ lib
, buildPythonPackage
, fetchFromGitHub
, python3
, pythonOlder
, django
, hatchling
, pyhamcrest
}:
let
version = "0.6.1";
in
buildPythonPackage {
pname = "django-currentuser";
inherit version;
pyproject = true;
src = fetchFromGitHub {
owner = "zsoldosp";
repo = "django-currentuser";
rev = "v${version}";
hash = "sha256-sxt4ZMkaFANINd1faIA5pqP8UoDMXElM3unsxcJU/ag=";
};
disabled = pythonOlder "3.8";
nativeBuildInputs = [ hatchling ];
propagatedBuildInputs = [ django ];
nativeCheckInputs = [ pyhamcrest ];
preCheck = ''
DJANGO_SETTINGS_MODULE="settings"
PYTHONPATH="tests:$PYTHONPATH"
'';
checkPhase = ''
runHook preCheck
${python3.interpreter} manage.py test testapp
runHook postCheck
'';
meta = with lib; {
description = "Conveniently store reference to request user on thread/db level";
homepage = "https://github.com/zsoldosp/django-currentuser";
changelog = "https://github.com/zsoldosp/django-currentuser/#release-notes";
license = licenses.bsd3;
maintainers = with maintainers; [ augustebaum ];
};
}