1{ lib, buildPythonPackage, fetchFromGitHub, python,
2 django, six
3}:
4
5buildPythonPackage rec {
6 pname = "django-compat";
7 version = "1.0.15";
8
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 = "1pr6v38ahrsvxlgmcx69s4b5q5082f44gzi4h3c32sccdc4pwqxp";
15 };
16
17 patches = [
18 ./fix-tests.diff
19 ];
20
21 checkPhase = ''
22 runHook preCheck
23
24 # to convince the tests to run against the installed package, not the source directory, we extract the
25 # tests directory from it then dispose of the actual source
26 mv compat/tests .
27 rm -r compat
28 substituteInPlace runtests.py --replace compat.tests tests
29 ${python.interpreter} runtests.py
30
31 runHook postCheck
32 '';
33
34 propagatedBuildInputs = [ django six ];
35
36 meta = with 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}