@@ -1,4 +1,4 @@
1−{ stdenv, buildPythonPackage, fetchurl,
1+{ stdenv, buildPythonPackage, fetchFromGitHub, python,
22 django, django_nose, six
33}:
44buildPythonPackage rec {
@@ -6,19 +6,38 @@ buildPythonPackage rec {
66 name = "${pname}-${version}";
77 version = "1.0.14";
88
9− src = fetchurl {
10− url = "mirror://pypi/d/django-compat/${name}.tar.gz";
11− sha256 = "18y5bxxmafcd4np42mzbalva5lpssq0b8ki7zckbzvdv2mnv43xj";
9+ # the pypi packages don't include everything required for the tests
10+ src = fetchFromGitHub {
11+ owner = "arteria";
12+ repo = "django-compat";
13+ rev = "v${version}";
14+ sha256 = "11g6ra6djkchqk44v8k7biaxd1v69qyyyask5l92vmrvb0qiwvm8";
1215 };
1316
14− doCheck = false;
17+ checkPhase = ''
18+ runHook preCheck
1519
16− buildInputs = [ django_nose ];
20+ # we have to do a little bit of tinkering to convince the tests to run against the installed package, not the
21+ # source directory
22+ mkdir -p testbase/compat
23+ pushd testbase
24+ # note we're not copying the direct contents of compat/ (notably __init__.py) so python won't recognize this as a
25+ # package, but the tests need to be in a specific path for the test templates to get picked up.
26+ cp -r ../compat/tests compat/
27+ cp ../runtests.py .
28+ ${python.interpreter} runtests.py compat/tests
29+ popd
30+
31+ runHook postCheck
32+ '';
33+
34+ checkInputs = [ django_nose ];
1735 propagatedBuildInputs = [ django six ];
1836
1937 meta = with stdenv.lib; {
2038 description = "Forward and backwards compatibility layer for Django 1.4, 1.7, 1.8, 1.9, 1.10 and 1.11";
2139 homepage = https://github.com/arteria/django-compat;
2240 license = licenses.mit;
41+ maintainers = with maintainers; [ ris ];
2342 };
2443}