2021-02-05 17:12:51 +00:00
|
|
|
{ lib
|
2020-04-24 23:36:52 +00:00
|
|
|
, buildPythonPackage
|
2022-04-27 09:35:20 +00:00
|
|
|
, fetchFromGitHub
|
2023-08-22 20:05:09 +00:00
|
|
|
, pythonOlder
|
|
|
|
|
|
|
|
# dependencies
|
2022-04-27 09:35:20 +00:00
|
|
|
, django
|
2020-04-24 23:36:52 +00:00
|
|
|
, pytz
|
2023-08-22 20:05:09 +00:00
|
|
|
|
|
|
|
# optionals
|
|
|
|
, django-taggit
|
|
|
|
|
|
|
|
# tests
|
|
|
|
, pytest-django
|
|
|
|
, pytestCheckHook
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "django-modelcluster";
|
2022-04-27 09:35:20 +00:00
|
|
|
version = "6.0";
|
|
|
|
format = "setuptools";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
disabled = pythonOlder "3.5";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "wagtail";
|
2023-08-22 20:05:09 +00:00
|
|
|
repo = "modelcluster";
|
|
|
|
rev = "refs/tags/v${version}";
|
2022-04-27 09:35:20 +00:00
|
|
|
hash = "sha256-p6hvOkPWRVJYLHvwyn9nS05wblikRFmlSYZuLiCcuqc=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
django
|
|
|
|
pytz
|
|
|
|
];
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
passthru.optional-dependencies.taggit = [
|
2022-04-27 09:35:20 +00:00
|
|
|
django-taggit
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-08-22 20:05:09 +00:00
|
|
|
env.DJANGO_SETTINGS_MODULE = "tests.settings";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-08-22 20:05:09 +00:00
|
|
|
nativeCheckInputs = [
|
|
|
|
pytest-django
|
|
|
|
pytestCheckHook
|
|
|
|
] ++ passthru.optional-dependencies.taggit;
|
|
|
|
|
|
|
|
# https://github.com/wagtail/django-modelcluster/issues/173
|
|
|
|
disabledTests = lib.optionals (lib.versionAtLeast django.version "4.2") [
|
|
|
|
"test_formfield_callback"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Django extension to allow working with 'clusters' of models as a single unit, independently of the database";
|
|
|
|
homepage = "https://github.com/torchbox/django-modelcluster/";
|
|
|
|
license = licenses.bsd2;
|
|
|
|
maintainers = with maintainers; [ desiderius ];
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|