1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pythonOlder,
6 django,
7 pytestCheckHook,
8 pytest-django,
9 parameterized,
10}:
11let
12 # 0.18.12 was yanked from PyPI, it refers to this issue:
13 # https://github.com/deschler/django-modeltranslation/issues/701
14 version = "0.18.12";
15in
16buildPythonPackage {
17 pname = "django-modeltranslation";
18 inherit version;
19
20 src = fetchFromGitHub {
21 owner = "deschler";
22 repo = "django-modeltranslation";
23 rev = "refs/tags/v${version}";
24 hash = "sha256-6rAAu3Fd4D93rX8kvkcqhykzBu/lDByQ6zpjWq7J8mg=";
25 };
26
27 # Remove all references to pytest-cov
28 postPatch = ''
29 substituteInPlace pytest.ini \
30 --replace "--no-cov-on-fail" "" \
31 --replace "--cov-report=\"\"" "" \
32 --replace "--cov modeltranslation" ""
33 '';
34
35 disabled = pythonOlder "3.6";
36
37 propagatedBuildInputs = [ django ];
38
39 nativeCheckInputs = [
40 pytestCheckHook
41 pytest-django
42 parameterized
43 ];
44
45 meta = with lib; {
46 description = "Translates Django models using a registration approach";
47 homepage = "https://github.com/deschler/django-modeltranslation";
48 license = licenses.bsd3;
49 maintainers = with maintainers; [ augustebaum ];
50 };
51}