1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, pythonOlder
5
6# dependencies
7, django
8, pytz
9
10# optionals
11, django-taggit
12
13# tests
14, pytest-django
15, pytestCheckHook
16}:
17
18buildPythonPackage rec {
19 pname = "django-modelcluster";
20 version = "6.0";
21 format = "setuptools";
22
23 disabled = pythonOlder "3.5";
24
25 src = fetchFromGitHub {
26 owner = "wagtail";
27 repo = "modelcluster";
28 rev = "refs/tags/v${version}";
29 hash = "sha256-p6hvOkPWRVJYLHvwyn9nS05wblikRFmlSYZuLiCcuqc=";
30 };
31
32 propagatedBuildInputs = [
33 django
34 pytz
35 ];
36
37 passthru.optional-dependencies.taggit = [
38 django-taggit
39 ];
40
41 env.DJANGO_SETTINGS_MODULE = "tests.settings";
42
43 nativeCheckInputs = [
44 pytest-django
45 pytestCheckHook
46 ] ++ passthru.optional-dependencies.taggit;
47
48 # https://github.com/wagtail/django-modelcluster/issues/173
49 disabledTests = lib.optionals (lib.versionAtLeast django.version "4.2") [
50 "test_formfield_callback"
51 ];
52
53 meta = with lib; {
54 description = "Django extension to allow working with 'clusters' of models as a single unit, independently of the database";
55 homepage = "https://github.com/torchbox/django-modelcluster/";
56 license = licenses.bsd2;
57 maintainers = with maintainers; [ desiderius ];
58 };
59
60}