1{ stdenv, buildPythonPackage, fetchFromGitHub, python, 2 django, django_compat, django_nose 3}: 4buildPythonPackage rec { 5 pname = "django-hijack"; 6 version = "2.1.5"; 7 name = pname + "-" + version; 8 9 # the pypi packages don't include everything required for the tests 10 src = fetchFromGitHub { 11 owner = "arteria"; 12 repo = "django-hijack"; 13 rev = "v${version}"; 14 sha256 = "1paiyxhc034336xcd9yzf3azpsapsv26j7w2baxiby71z2hhg0sj"; 15 }; 16 17 checkInputs = [ django_nose ]; 18 propagatedBuildInputs = [ django django_compat ]; 19 20 checkPhase = '' 21 runHook preCheck 22 23 # we have to do a little bit of tinkering to convince the tests to run against the installed package, not the 24 # source directory 25 mkdir testbase 26 pushd testbase 27 cp ../runtests.py . 28 ${python.interpreter} runtests.py hijack 29 popd 30 31 runHook postCheck 32 ''; 33 34 meta = with stdenv.lib; { 35 description = "Allows superusers to hijack (=login as) and work on behalf of another user"; 36 homepage = https://github.com/arteria/django-hijack; 37 license = licenses.mit; 38 maintainers = with maintainers; [ ris ]; 39 }; 40}