2021-01-25 09:26:54 +01:00
|
|
|
{ lib, buildPythonPackage, fetchFromGitHub, python,
|
2019-01-19 14:02:44 +01:00
|
|
|
django, six
|
2017-04-27 16:18:14 +02:00
|
|
|
}:
|
2020-02-13 06:15:56 +01:00
|
|
|
|
2017-04-27 16:18:14 +02:00
|
|
|
buildPythonPackage rec {
|
2017-05-27 11:25:35 +02:00
|
|
|
pname = "django-compat";
|
2019-01-19 14:02:44 +01:00
|
|
|
version = "1.0.15";
|
2017-04-27 16:18:14 +02:00
|
|
|
|
2017-05-28 02:07:47 +02:00
|
|
|
# the pypi packages don't include everything required for the tests
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "arteria";
|
|
|
|
repo = "django-compat";
|
|
|
|
rev = "v${version}";
|
2019-01-19 14:02:44 +01:00
|
|
|
sha256 = "1pr6v38ahrsvxlgmcx69s4b5q5082f44gzi4h3c32sccdc4pwqxp";
|
2017-04-27 16:18:14 +02:00
|
|
|
};
|
|
|
|
|
2020-03-06 15:41:49 +01:00
|
|
|
patches = [
|
|
|
|
./fix-tests.diff
|
|
|
|
];
|
|
|
|
|
2017-05-28 02:07:47 +02:00
|
|
|
checkPhase = ''
|
|
|
|
runHook preCheck
|
2017-04-27 16:18:14 +02:00
|
|
|
|
2019-01-19 14:02:44 +01:00
|
|
|
# to convince the tests to run against the installed package, not the source directory, we extract the
|
|
|
|
# tests directory from it then dispose of the actual source
|
|
|
|
mv compat/tests .
|
|
|
|
rm -r compat
|
|
|
|
substituteInPlace runtests.py --replace compat.tests tests
|
|
|
|
${python.interpreter} runtests.py
|
2017-05-28 02:07:47 +02:00
|
|
|
|
|
|
|
runHook postCheck
|
|
|
|
'';
|
|
|
|
|
2017-04-27 16:18:14 +02:00
|
|
|
propagatedBuildInputs = [ django six ];
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2017-04-27 16:18:14 +02:00
|
|
|
description = "Forward and backwards compatibility layer for Django 1.4, 1.7, 1.8, 1.9, 1.10 and 1.11";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://github.com/arteria/django-compat";
|
2017-04-27 16:18:14 +02:00
|
|
|
license = licenses.mit;
|
2017-05-28 02:07:47 +02:00
|
|
|
maintainers = with maintainers; [ ris ];
|
2017-04-27 16:18:14 +02:00
|
|
|
};
|
2017-05-01 17:42:13 +02:00
|
|
|
}
|