From 43f0d6603f68898fcc4c0160180ad2ffe36cd871 Mon Sep 17 00:00:00 2001 From: Jonas Heinrich Date: Sun, 27 Oct 2024 18:11:34 +0100 Subject: [PATCH 1/3] python3Packages.django-cms: init at 4.1.3 --- .../python-modules/django-cms/default.nix | 101 ++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 103 insertions(+) create mode 100644 pkgs/development/python-modules/django-cms/default.nix diff --git a/pkgs/development/python-modules/django-cms/default.nix b/pkgs/development/python-modules/django-cms/default.nix new file mode 100644 index 000000000000..34f61bdfd6e6 --- /dev/null +++ b/pkgs/development/python-modules/django-cms/default.nix @@ -0,0 +1,101 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + django, + pythonOlder, + setuptools, + django-classy-tags, + django-formtools, + django-treebeard, + django-sekizai, + djangocms-admin-style, + python, + dj-database-url, + djangocms-text-ckeditor, + fetchpatch, + django-cms, + gettext, + iptools, +}: + +buildPythonPackage rec { + pname = "django-cms"; + version = "4.1.3"; + pyproject = true; + + disabled = pythonOlder "3.9"; + + src = fetchFromGitHub { + owner = "django-cms"; + repo = "django-cms"; + rev = "refs/tags/${version}"; + hash = "sha256-ucGxc6f2UYdmSLuyxVV2nIcl35qoeQMlk1paN6XeBFY="; + }; + + patches = [ + # Removed django-app-manage dependency by updating ./manage.py + # https://github.com/django-cms/django-cms/pull/8061 + (fetchpatch { + url = "https://github.com/django-cms/django-cms/commit/3270edb72f6a736b5cb448864ce2eaf68f061740.patch"; + hash = "sha256-DkgAfE/QGAXwKMNvgcYxtO0yAc7oAaAAui2My8ml1Vk="; + name = "remove_django_app_manage_dependency.patch"; + }) + (fetchpatch { + url = "https://github.com/django-cms/django-cms/pull/8061/commits/04005ff693e775db645c62fefbb62367822e66f9.patch"; + hash = "sha256-4M/VKEv7pnqCk6fDyA6FurSCCu/k9tNnz16wT4Tr0Rw="; + name = "manage_py_update_dj_database_url.patch"; + }) + ]; + + build-system = [ setuptools ]; + + dependencies = [ + django + django-classy-tags + django-formtools + django-treebeard + django-sekizai + djangocms-admin-style + ]; + + nativeCheckInputs = [ gettext ]; + + checkInputs = [ + dj-database-url + djangocms-text-ckeditor + iptools + ]; + + preCheck = '' + # Disable ruff formatter test + rm cms/tests/test_static_analysis.py + ''; + + checkPhase = '' + runHook preCheck + ${python.interpreter} manage.py test + runHook postCheck + ''; + + # Tests depend on djangocms-text-ckeditor and djangocms-admin-style, + # which depends on this package. + # To avoid infinite recursion, we only enable tests when building passthru.tests. + doCheck = false; + + passthru.tests = { + runTests = django-cms.overridePythonAttrs (_: { + doCheck = true; + }); + }; + + pythonImportCheck = [ "cms" ]; + + meta = { + description = "Lean enterprise content management powered by Django"; + homepage = "https://django-cms.org"; + changelog = "https://github.com/django-cms/django-cms/releases/tag/${version}"; + license = lib.licenses.bsd3; + maintainers = [ lib.maintainers.onny ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index eb1a12c33f6a..fd1fe1b4ebc0 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3367,6 +3367,8 @@ self: super: with self; { django-cleanup = callPackage ../development/python-modules/django-cleanup { }; + django-cms = callPackage ../development/python-modules/django-cms { }; + django-colorful = callPackage ../development/python-modules/django-colorful { }; django-compressor = callPackage ../development/python-modules/django-compressor { }; From f56f7e0c2a5a35eb1c5a5420b9d753d62d831fa9 Mon Sep 17 00:00:00 2001 From: Jonas Heinrich Date: Thu, 24 Oct 2024 08:23:57 +0200 Subject: [PATCH 2/3] python3Packages.djangocms-admin-style: init at 3.3.1 --- .../djangocms-admin-style/default.nix | 73 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 75 insertions(+) create mode 100644 pkgs/development/python-modules/djangocms-admin-style/default.nix diff --git a/pkgs/development/python-modules/djangocms-admin-style/default.nix b/pkgs/development/python-modules/djangocms-admin-style/default.nix new file mode 100644 index 000000000000..98791482ec83 --- /dev/null +++ b/pkgs/development/python-modules/djangocms-admin-style/default.nix @@ -0,0 +1,73 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + django, + pythonOlder, + pytestCheckHook, + setuptools, + pytest-django, + django-cms, + djangocms-admin-style, +}: + +buildPythonPackage rec { + pname = "djangocms-admin-style"; + version = "3.3.1"; + pyproject = true; + + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "django-cms"; + repo = "djangocms-admin-style"; + rev = "refs/tags/${version}"; + hash = "sha256-cDbmC7IJTT3NuVXBnbUVqC7dUfusMdntDGu2tSvxIdQ="; + }; + + build-system = [ setuptools ]; + + dependencies = [ django ]; + + nativeCheckInputs = [ + pytestCheckHook + pytest-django + ]; + + checkInputs = [ django-cms ]; + + preCheck = '' + export DJANGO_SETTINGS_MODULE="tests.settings" + ''; + + disabledTests = [ + # django.template.exceptions.TemplateDoesNotExist: admin/inc/cms_upgrade_notification.html + "test_render_update_notification" + # AssertionError: 'my site' != 'example.com' + "test_current_site_name" + # django.core.exceptions.ImproperlyConfigured: settings.DATABASES is improperly configured + "test_render_update_notification" + "test_current_site_name" + "test_for_missing_migrations" + ]; + + # Tests depend on django-cms which depends on this package. + # To avoid infinite recursion, we only enable tests when building passthru.tests. + doCheck = false; + + passthru.tests = { + runTests = djangocms-admin-style.overridePythonAttrs (_: { + doCheck = true; + }); + }; + + pythonImportCheck = [ "djangocms_admin_style" ]; + + meta = { + description = "Django Theme tailored to the needs of django CMS"; + homepage = "https://django-cms.org"; + changelog = "https://github.com/django-cms/djangocms-admin-style/releases/tag/${version}"; + license = lib.licenses.bsd3; + maintainers = [ lib.maintainers.onny ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index fd1fe1b4ebc0..ebe72fdbb1f8 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3319,6 +3319,8 @@ self: super: with self; { # Pre-release django_5 = callPackage ../development/python-modules/django/5.nix { }; + djangocms-admin-style = callPackage ../development/python-modules/djangocms-admin-style { }; + django-admin-datta = callPackage ../development/python-modules/django-admin-datta { }; django-admin-sortable2 = callPackage ../development/python-modules/django-admin-sortable2 { }; From 88890306fe58a4e1ef1fe26f4314ca1789f2bfac Mon Sep 17 00:00:00 2001 From: Jonas Heinrich Date: Mon, 4 Nov 2024 15:06:34 +0100 Subject: [PATCH 3/3] python3Packages.djangocms-text-ckeditor: init at 5.1.6 --- .../djangocms-text-ckeditor/default.nix | 56 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 58 insertions(+) create mode 100644 pkgs/development/python-modules/djangocms-text-ckeditor/default.nix diff --git a/pkgs/development/python-modules/djangocms-text-ckeditor/default.nix b/pkgs/development/python-modules/djangocms-text-ckeditor/default.nix new file mode 100644 index 000000000000..006ff490534c --- /dev/null +++ b/pkgs/development/python-modules/djangocms-text-ckeditor/default.nix @@ -0,0 +1,56 @@ +{ + lib, + buildPythonPackage, + fetchPypi, + pythonOlder, + pytestCheckHook, + setuptools, + html5lib, + pillow, + django-cms, + pytest-django, +}: + +buildPythonPackage rec { + pname = "djangocms-text-ckeditor"; + version = "5.1.6"; + pyproject = true; + + disabled = pythonOlder "3.7"; + + src = fetchPypi { + inherit version; + pname = "djangocms_text_ckeditor"; + hash = "sha256-ow2S4FJkO037QUkAf3FheVl2O4BaLw1PSSCVRBhlRX0="; + }; + + build-system = [ setuptools ]; + + dependencies = [ + django-cms + html5lib + pillow + ]; + + nativeCheckInputs = [ + pytestCheckHook + pytest-django + ]; + + preCheck = '' + export DJANGO_SETTINGS_MODULE="tests.settings" + ''; + + # Tests require module "djangocms-helper" which is not yet packaged + doCheck = false; + + pythonImportCheck = [ "djangocms_text_ckeditor" ]; + + meta = { + description = "Text Plugin for django CMS using CKEditor 4"; + homepage = "https://github.com/django-cms/djangocms-text-ckeditor"; + changelog = "https://github.com/django-cms/djangocms-text-ckeditor/blob/${version}/CHANGELOG.rst"; + license = lib.licenses.bsd3; + maintainers = [ lib.maintainers.onny ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index ebe72fdbb1f8..85e07eee808c 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3321,6 +3321,8 @@ self: super: with self; { djangocms-admin-style = callPackage ../development/python-modules/djangocms-admin-style { }; + djangocms-text-ckeditor = callPackage ../development/python-modules/djangocms-text-ckeditor { }; + django-admin-datta = callPackage ../development/python-modules/django-admin-datta { }; django-admin-sortable2 = callPackage ../development/python-modules/django-admin-sortable2 { };