python3Packages.django-hijack: 2.1.10 -> 3.2.0

switch to using wheel for its pre-built assets
This commit is contained in:
Robert Scott 2022-04-09 21:21:37 +01:00
parent 2e8714c5fc
commit 3760e94ffa

View File

@ -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";