diff --git a/pkgs/development/python-modules/django-modelsearch/default.nix b/pkgs/development/python-modules/modelsearch/default.nix similarity index 63% rename from pkgs/development/python-modules/django-modelsearch/default.nix rename to pkgs/development/python-modules/modelsearch/default.nix index 73fd60e8d7be..142199c417d3 100644 --- a/pkgs/development/python-modules/django-modelsearch/default.nix +++ b/pkgs/development/python-modules/modelsearch/default.nix @@ -11,21 +11,24 @@ django-tasks, # tests - pytest-django, - pytestCheckHook, django-modelcluster, + django-taggit, + dj-database-url, + psycopg, + pytestCheckHook, + pytest-django, }: -buildPythonPackage rec { +buildPythonPackage (finalAttrs: { pname = "modelsearch"; - version = "1.1.1"; + version = "1.2.0"; pyproject = true; src = fetchFromGitHub { owner = "wagtail"; repo = "django-modelsearch"; - tag = "v${version}"; - hash = "sha256-tjwVepI9mdrMbTtxfe6yNUrSHWKndGxv2lJ8AfyNcr0="; + tag = "v${finalAttrs.version}"; + hash = "sha256-zmurjjiJO6A/9XuGsGQcBWRX4NW9xVCFkCVRUk0Ziro="; }; build-system = [ @@ -34,21 +37,30 @@ buildPythonPackage rec { dependencies = [ django - django-modelcluster django-tasks ]; pythonImportsCheck = [ "modelsearch" ]; - # django.core.exceptions.ImproperlyConfigured: Requested setting INSTALLED_APPS, but settings are not configured. - # You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings. - doCheck = false; + nativeCheckInputs = [ + dj-database-url + psycopg + django-modelcluster + django-taggit + pytest-django + pytestCheckHook + ]; + + preCheck = '' + export DJANGO_SETTINGS_MODULE=modelsearch.test.settings + export SEARCH_BACKEND=db + ''; meta = { description = "Index Django Models with Elasticsearch or OpenSearch and query them with the ORM"; homepage = "https://github.com/wagtail/django-modelsearch"; - changelog = "https://github.com/wagtail/django-modelsearch/releases/tag/${src.tag}"; + changelog = "https://github.com/wagtail/django-modelsearch/releases/tag/${finalAttrs.src.tag}"; license = lib.licenses.bsd3; maintainers = with lib.maintainers; [ GaetanLepage ]; }; -} +}) diff --git a/pkgs/development/python-modules/rq/default.nix b/pkgs/development/python-modules/rq/default.nix index 907ccdf3fd0d..246d508816a8 100644 --- a/pkgs/development/python-modules/rq/default.nix +++ b/pkgs/development/python-modules/rq/default.nix @@ -20,16 +20,16 @@ versionCheckHook, }: -buildPythonPackage rec { +buildPythonPackage (finalAttrs: { pname = "rq"; - version = "2.6.1"; + version = "2.7"; pyproject = true; src = fetchFromGitHub { owner = "rq"; repo = "rq"; - tag = "v${version}"; - hash = "sha256-4+zP3pOiZ+r/dt9F2NyxgJsyGPIHgj9XokuPxlWyS1g="; + tag = "v${finalAttrs.version}"; + hash = "sha256-332K+n3mWf+k7/QvIFJFhuDXqd1t2p8ZVv/l+Y167Bk="; }; build-system = [ hatchling ]; @@ -68,8 +68,8 @@ buildPythonPackage rec { meta = { description = "Library for creating background jobs and processing them"; homepage = "https://github.com/nvie/rq/"; - changelog = "https://github.com/rq/rq/releases/tag/${src.tag}"; + changelog = "https://github.com/rq/rq/releases/tag/${finalAttrs.src.tag}"; license = lib.licenses.bsd2; maintainers = with lib.maintainers; [ mrmebelman ]; }; -} +}) diff --git a/pkgs/development/python-modules/wagtail/default.nix b/pkgs/development/python-modules/wagtail/default.nix index 9093204a71f3..4fdbdcc0c803 100644 --- a/pkgs/development/python-modules/wagtail/default.nix +++ b/pkgs/development/python-modules/wagtail/default.nix @@ -1,7 +1,12 @@ { lib, buildPythonPackage, - fetchPypi, + fetchFromGitHub, + + # frontend + fetchNpmDeps, + nodejs, + npmHooks, # build-system setuptools, @@ -12,13 +17,13 @@ django, django-filter, django-modelcluster, - django-modelsearch, django-taggit, django-tasks, django-treebeard, djangorestframework, draftjs-exporter, laces, + modelsearch, openpyxl, permissionedforms, pillow, @@ -30,24 +35,42 @@ callPackage, }: -buildPythonPackage rec { +buildPythonPackage (finalAttrs: { pname = "wagtail"; - version = "7.2.2"; + version = "7.3"; pyproject = true; - # The GitHub source requires some assets to be compiled, which in turn - # requires fixing the upstream package lock. We need to use the PyPI release - # until https://github.com/wagtail/wagtail/pull/13136 gets merged. - src = fetchPypi { - inherit pname version; - hash = "sha256-v2rao6zZDZ7nc0dW3XAxsJAe7bgKSqTlGIqx5IHOML4="; + src = fetchFromGitHub { + owner = "wagtail"; + repo = "wagtail"; + tag = "v${finalAttrs.version}"; + hash = "sha256-o/4jn32ffR3BPVNwtFKJ6PowXYi7SpjBqghdeZIl5tM="; }; + nativeBuildInputs = [ + npmHooks.npmConfigHook + nodejs + ]; + + npmDeps = fetchNpmDeps { + inherit (finalAttrs) src; + hash = "sha256-Uc16K1RZUCnr4qRe2u4yB44F+zYFBxMpEQCz5992RMA="; + }; + + preBuild = '' + # upstream only provides a hook for sdists, not wheels + # https://github.com/wagtail/wagtail/blob/v7.3/setup.py#L22 + npm run build + ''; + build-system = [ setuptools ]; - pythonRelaxDeps = [ "django-tasks" ]; + pythonRelaxDeps = [ + "django-tasks" + "modelsearch" + ]; dependencies = [ anyascii @@ -55,13 +78,13 @@ buildPythonPackage rec { django django-filter django-modelcluster - django-modelsearch django-taggit django-tasks django-treebeard djangorestframework draftjs-exporter laces + modelsearch openpyxl permissionedforms pillow @@ -83,8 +106,8 @@ buildPythonPackage rec { description = "Django content management system focused on flexibility and user experience"; mainProgram = "wagtail"; homepage = "https://github.com/wagtail/wagtail"; - changelog = "https://github.com/wagtail/wagtail/blob/v${version}/CHANGELOG.txt"; + changelog = "https://github.com/wagtail/wagtail/blob/${finalAttrs.src.tag}/CHANGELOG.txt"; license = lib.licenses.bsd3; maintainers = with lib.maintainers; [ sephi ]; }; -} +}) diff --git a/pkgs/top-level/python-aliases.nix b/pkgs/top-level/python-aliases.nix index 808e04e22d49..6f66261976e6 100644 --- a/pkgs/top-level/python-aliases.nix +++ b/pkgs/top-level/python-aliases.nix @@ -146,6 +146,7 @@ mapAliases { django-crispy-bootstrap3 = crispy-bootstrap3; # added 2025-06-11 django-crispy-bootstrap4 = crispy-bootstrap4; # added 2025-06-11 django-crispy-bootstrap5 = crispy-bootstrap5; # added 2025-06-11 + django-modelsearch = modelsearch; # added 2026-03-02 django_3 = throw "Django 3 has reached it's EOL in 2024-04 and has therefore been removed."; # added 2025-01-25 django_5_1 = throw "Django 5.1 has reached it's EOL in 2025-12 and has therefore been removed."; # added 2025-11-30" django_5_2 = django_5; # added 2026-01-18 diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 8e27fb27d8d6..00c9ebb71edb 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -4256,8 +4256,6 @@ self: super: with self; { django-modelcluster = callPackage ../development/python-modules/django-modelcluster { }; - django-modelsearch = callPackage ../development/python-modules/django-modelsearch { }; - django-modeltranslation = callPackage ../development/python-modules/django-modeltranslation { }; django-mptt = callPackage ../development/python-modules/django-mptt { }; @@ -10068,6 +10066,8 @@ self: super: with self; { modelscope = callPackage ../development/python-modules/modelscope { }; + modelsearch = callPackage ../development/python-modules/modelsearch { }; + modern-colorthief = callPackage ../development/python-modules/modern-colorthief { }; moderngl = callPackage ../development/python-modules/moderngl { };