diff --git a/pkgs/development/python-modules/django-hijack/default.nix b/pkgs/development/python-modules/django-hijack/default.nix index fd9c30a4bc7c..78cce76ca5b0 100644 --- a/pkgs/development/python-modules/django-hijack/default.nix +++ b/pkgs/development/python-modules/django-hijack/default.nix @@ -1,34 +1,34 @@ -{ lib, buildPythonPackage, fetchFromGitHub, python, - django, django_compat, django_nose +{ lib +, fetchPypi +, buildPythonPackage +, django +, django_compat +, pytest-django +, pytestCheckHook }: + buildPythonPackage rec { pname = "django-hijack"; - version = "2.1.10"; + version = "3.2.0"; - # the pypi packages don't include everything required for the tests - src = fetchFromGitHub { - owner = "arteria"; - repo = "django-hijack"; - rev = "v${version}"; - sha256 = "01fwkjdzvw0yx2spwi7zc1yy64ndq1y72bfmk7kxnq5x803m2ak6"; + # the wheel comes with pre-built assets, allowing us to avoid fighting + # with npm/webpack/gettext to build them ourselves. + format = "wheel"; + src = fetchPypi { + inherit version format; + pname = "django_hijack"; + dist = "py3"; + python = "py3"; + sha256 = "1ixn7ppmbq1bgqahwv3z57hk80ql7sxpwl8jms7y8w5z1h91cn86"; }; - checkInputs = [ django_nose ]; propagatedBuildInputs = [ django django_compat ]; - checkPhase = '' - runHook preCheck - - # we have to do a little bit of tinkering to convince the tests to run against the installed package, not the - # source directory - mkdir testbase - pushd testbase - mv ../runtests.py . - ${python.interpreter} runtests.py hijack - popd - - runHook postCheck + checkInputs = [ pytestCheckHook pytest-django ]; + preCheck = '' + export DJANGO_SETTINGS_MODULE='hijack.tests.test_app.settings' ''; + pytestFlagsArray = [ "--pyargs" "hijack" ]; meta = with lib; { description = "Allows superusers to hijack (=login as) and work on behalf of another user";