Merge pull request #307098 from r-ryantm/auto-update/cilium-cli
[NixPkgs.git] / pkgs / development / python-modules / django-hijack / default.nix
blob427a8e2311398a34e50e8d607278af73254ae5be
1 { lib
2 , fetchFromGitHub
3 , fetchNpmDeps
4 , buildPythonPackage
5 , nix-update-script
7 # build-system
8 , gettext
9 , nodejs
10 , npmHooks
11 , setuptools-scm
13 # dependencies
14 , django
16 # tests
17 , pytest-django
18 , pytestCheckHook
21 buildPythonPackage rec {
22   pname = "django-hijack";
23   version = "3.4.5";
24   format = "setuptools";
26   src = fetchFromGitHub {
27     owner = "django-hijack";
28     repo = "django-hijack";
29     rev = "refs/tags/${version}";
30     hash = "sha256-FXh5OFMTjsKgjEeIS+CiOwyGOs4AisJA+g49rCILDsQ=";
31   };
33   postPatch = ''
34     substituteInPlace setup.py \
35       --replace 'cmd = ["npm", "ci"]' 'cmd = ["true"]' \
36       --replace 'f"{self.build_lib}/{name}.mo"' 'f"{name}.mo"'
38     sed -i "/addopts/d" setup.cfg
39   '';
41   npmDeps = fetchNpmDeps {
42     inherit src;
43     hash = "sha256-cZEr/7FW4vCR8gpraT+/rPwYK9Xn22b5WH7lnuK5L4U=";
44   };
46   nativeBuildInputs = [
47     gettext
48     nodejs
49     npmHooks.npmConfigHook
50     setuptools-scm
51   ];
53   propagatedBuildInputs = [
54     django
55   ];
57   nativeCheckInputs = [
58     pytestCheckHook
59     pytest-django
60   ];
62   env.DJANGO_SETTINGS_MODULE = "hijack.tests.test_app.settings";
64   pytestFlagsArray = [
65     "--pyargs" "hijack"
66     "-W" "ignore::DeprecationWarning"
67   ];
69   # needed for npmDeps update
70   passthru.updateScript = nix-update-script { };
72   meta = with lib; {
73     description = "Allows superusers to hijack (=login as) and work on behalf of another user";
74     homepage = "https://github.com/arteria/django-hijack";
75     changelog = "https://github.com/django-hijack/django-hijack/releases/tag/${version}";
76     license = licenses.mit;
77     maintainers = with maintainers; [ ris ];
78   };