1{ stdenv, buildPythonPackage, fetchFromGitHub, python,
2 django, six
3}:
4buildPythonPackage rec {
5 pname = "django-compat";
6 version = "1.0.15";
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 = "1pr6v38ahrsvxlgmcx69s4b5q5082f44gzi4h3c32sccdc4pwqxp";
14 };
15
16 checkPhase = ''
17 runHook preCheck
18
19 # to convince the tests to run against the installed package, not the source directory, we extract the
20 # tests directory from it then dispose of the actual source
21 mv compat/tests .
22 rm -r compat
23 substituteInPlace runtests.py --replace compat.tests tests
24 ${python.interpreter} runtests.py
25
26 runHook postCheck
27 '';
28
29 propagatedBuildInputs = [ django six ];
30
31 meta = with stdenv.lib; {
32 description = "Forward and backwards compatibility layer for Django 1.4, 1.7, 1.8, 1.9, 1.10 and 1.11";
33 homepage = https://github.com/arteria/django-compat;
34 license = licenses.mit;
35 maintainers = with maintainers; [ ris ];
36 };
37}