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