diff --git a/pkgs/by-name/pr/pretalx/package.nix b/pkgs/by-name/pr/pretalx/package.nix index 372d86d44415..7098f3975c29 100644 --- a/pkgs/by-name/pr/pretalx/package.nix +++ b/pkgs/by-name/pr/pretalx/package.nix @@ -95,6 +95,7 @@ python.pkgs.buildPythonApplication rec { "django-csp" "django-filter" "django-formset-js-improved" + "django-formtools" "django-i18nfield" "djangorestframework" "markdown" diff --git a/pkgs/by-name/pr/pretix/package.nix b/pkgs/by-name/pr/pretix/package.nix index 9cd89e0d4528..e7146d5fe3f1 100644 --- a/pkgs/by-name/pr/pretix/package.nix +++ b/pkgs/by-name/pr/pretix/package.nix @@ -99,6 +99,7 @@ python.pkgs.buildPythonApplication rec { "django-compressor" "django-filter" "django-formset-js-improved" + "django-formtools" "django-i18nfield" "django-localflavor" "django-phonenumber-field" diff --git a/pkgs/development/python-modules/django-formtools/default.nix b/pkgs/development/python-modules/django-formtools/default.nix index 5ece57bbcf67..c4b1afd38033 100644 --- a/pkgs/development/python-modules/django-formtools/default.nix +++ b/pkgs/development/python-modules/django-formtools/default.nix @@ -2,41 +2,56 @@ lib, buildPythonPackage, django, - fetchPypi, - python, + fetchFromGitHub, + setuptools, setuptools-scm, + pytestCheckHook, + pytest-django, }: -buildPythonPackage rec { +buildPythonPackage (finalAttrs: { pname = "django-formtools"; - version = "2.5.1"; + version = "2.6.1"; pyproject = true; - src = fetchPypi { - inherit pname version; - hash = "sha256-R8s0VSxu/KCIhj1pMoTQT8NuqvNQ6yHhodk14N9SPJM="; + src = fetchFromGitHub { + owner = "jazzband"; + repo = "django-formtools"; + tag = finalAttrs.version; + hash = "sha256-cg6bl2KJL2aOES7vWqrR25Bd6t9vWGTZLWtbMUhkCkg="; }; - nativeBuildInputs = [ setuptools-scm ]; + build-system = [ + setuptools + setuptools-scm + ]; - propagatedBuildInputs = [ django ]; + dependencies = [ django ]; - checkPhase = '' - runHook preCheck + nativeCheckInputs = [ + pytestCheckHook + pytest-django + ]; - ${python.interpreter} -m django test --settings=tests.settings - - runHook postCheck + preCheck = '' + export DJANGO_SETTINGS_MODULE=tests.settings ''; + disabledTests = [ + # mismatch between test collection of django and pytest-django + "TestStorage" + # Django 6.0.6/5.2.15 compat issue + # https://github.com/jazzband/django-formtools/issues/298 + "test_reset_cookie" + ]; + pythonImportsCheck = [ "formtools" ]; meta = { - description = "Set of high-level abstractions for Django forms"; + description = "High-level abstractions for Django forms"; homepage = "https://github.com/jazzband/django-formtools"; - changelog = "https://github.com/jazzband/django-formtools/blob/master/docs/changelog.rst"; + changelog = "https://github.com/jazzband/django-formtools/blob/${finalAttrs.src.tag}/docs/changelog.rst"; license = lib.licenses.bsd3; - maintainers = [ - ]; + maintainers = [ ]; }; -} +}) diff --git a/pkgs/development/python-modules/django/6.nix b/pkgs/development/python-modules/django/6.nix index 38c746fb5718..4b6e54569b85 100644 --- a/pkgs/development/python-modules/django/6.nix +++ b/pkgs/development/python-modules/django/6.nix @@ -42,7 +42,7 @@ buildPythonPackage (finalAttrs: { pname = "django"; - version = "6.0.5"; + version = "6.0.6"; pyproject = true; disabled = pythonOlder "3.12"; @@ -51,7 +51,7 @@ buildPythonPackage (finalAttrs: { owner = "django"; repo = "django"; tag = finalAttrs.version; - hash = "sha256-jII/aoJ75sS+ig4iVZmTcsEE76aC8Om/k2J+LnRj+cE="; + hash = "sha256-hLnTqY64PfaGJ1JJccrxYms41Jp4E4pVq6rmrtFpESE="; }; patches = [ @@ -62,6 +62,9 @@ buildPythonPackage (finalAttrs: { ./6.x/pythonpath.patch # test_incorrect_timezone should raise but doesn't ./6.x/disable-failing-test.patch + # https://code.djangoproject.com/ticket/36997 + # https://github.com/django/django/pull/21019 + ./6.x/invalidate-importlib-cache.patch ] ++ lib.optionals withGdal [ (replaceVars ./6.x/gdal.patch { diff --git a/pkgs/development/python-modules/django/6.x/invalidate-importlib-cache.patch b/pkgs/development/python-modules/django/6.x/invalidate-importlib-cache.patch new file mode 100644 index 000000000000..910b6477cd32 --- /dev/null +++ b/pkgs/development/python-modules/django/6.x/invalidate-importlib-cache.patch @@ -0,0 +1,54 @@ +From 130ccbf51a5ad4810dcef46584661a818b7964d3 Mon Sep 17 00:00:00 2001 +From: gghezext +Date: Sun, 29 Mar 2026 03:46:48 +0200 +Subject: [PATCH 1/2] Fixed #36997 -- Invalidated importlib caches after + writing migration files. + +--- + django/core/management/commands/makemigrations.py | 3 +++ + django/core/management/commands/squashmigrations.py | 2 ++ + docs/releases/6.1.txt | 5 ++++- + 3 files changed, 9 insertions(+), 1 deletion(-) + +diff --git a/django/core/management/commands/makemigrations.py b/django/core/management/commands/makemigrations.py +index 7f711ed7aec4..355d626ce2c4 100644 +--- a/django/core/management/commands/makemigrations.py ++++ b/django/core/management/commands/makemigrations.py +@@ -1,3 +1,4 @@ ++import importlib + import os + import sys + import warnings +@@ -395,6 +396,7 @@ def write_migration_files(self, changes, update_previous_migration_paths=None): + ) + self.log(writer.as_string()) + run_formatters(self.written_files, stderr=self.stderr) ++ importlib.invalidate_caches() + + @staticmethod + def get_relative_path(path): +@@ -502,6 +504,7 @@ def all_items_equal(seq): + with open(writer.path, "w", encoding="utf-8") as fh: + fh.write(writer.as_string()) + run_formatters([writer.path], stderr=self.stderr) ++ importlib.invalidate_caches() + if self.verbosity > 0: + self.log("\nCreated new merge migration %s" % writer.path) + if self.scriptable: +diff --git a/django/core/management/commands/squashmigrations.py b/django/core/management/commands/squashmigrations.py +index 9845b4d4567b..abc87717b66b 100644 +--- a/django/core/management/commands/squashmigrations.py ++++ b/django/core/management/commands/squashmigrations.py +@@ -1,3 +1,4 @@ ++import importlib + import os + import shutil + +@@ -208,6 +209,7 @@ def handle(self, **options): + with open(writer.path, "w", encoding="utf-8") as fh: + fh.write(writer.as_string()) + run_formatters([writer.path], stderr=self.stderr) ++ importlib.invalidate_caches() + + if self.verbosity > 0: + self.stdout.write(