1{ stdenv, buildPythonPackage, fetchFromGitHub, python, 2 django, django_nose, six 3}: 4buildPythonPackage rec { 5 pname = "django-compat"; 6 version = "1.0.14"; 7 8 # the pypi packages don't include everything required for the tests 9 src = fetchFromGitHub { 10 owner = "arteria"; 11 repo = "django-compat"; 12 rev = "v${version}"; 13 sha256 = "11g6ra6djkchqk44v8k7biaxd1v69qyyyask5l92vmrvb0qiwvm8"; 14 }; 15 16 checkPhase = '' 17 runHook preCheck 18 19 # we have to do a little bit of tinkering to convince the tests to run against the installed package, not the 20 # source directory 21 mkdir -p testbase/compat 22 pushd testbase 23 # note we're not copying the direct contents of compat/ (notably __init__.py) so python won't recognize this as a 24 # package, but the tests need to be in a specific path for the test templates to get picked up. 25 cp -r ../compat/tests compat/ 26 cp ../runtests.py . 27 ${python.interpreter} runtests.py compat/tests 28 popd 29 30 runHook postCheck 31 ''; 32 33 checkInputs = [ django_nose ]; 34 propagatedBuildInputs = [ django six ]; 35 36 meta = with stdenv.lib; { 37 description = "Forward and backwards compatibility layer for Django 1.4, 1.7, 1.8, 1.9, 1.10 and 1.11"; 38 homepage = https://github.com/arteria/django-compat; 39 license = licenses.mit; 40 maintainers = with maintainers; [ ris ]; 41 }; 42}