From 3e58a13a910877703d6b7b043363f32449c92b8b Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sat, 8 Aug 2026 23:24:08 +0200 Subject: [PATCH 01/17] python3Packages.django_6: 6.0.8 -> 6.1.1 https://docs.djangoproject.com/en/6.1/releases/6.1/ https://docs.djangoproject.com/en/6.1/releases/6.1.1/ https://www.djangoproject.com/weblog/2026/aug/05/django-61-released/ Splits off 6.0.x as django_6_0 for continued package compatibility. --- .../django/6.0/skip-flaky-tests.patch | 12 ++ pkgs/development/python-modules/django/6.nix | 6 +- .../django/6.x/skip-flaky-tests.patch | 10 +- .../development/python-modules/django/6_0.nix | 147 ++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 5 files changed, 168 insertions(+), 9 deletions(-) create mode 100644 pkgs/development/python-modules/django/6.0/skip-flaky-tests.patch create mode 100644 pkgs/development/python-modules/django/6_0.nix diff --git a/pkgs/development/python-modules/django/6.0/skip-flaky-tests.patch b/pkgs/development/python-modules/django/6.0/skip-flaky-tests.patch new file mode 100644 index 000000000000..e9f3dda965be --- /dev/null +++ b/pkgs/development/python-modules/django/6.0/skip-flaky-tests.patch @@ -0,0 +1,12 @@ +diff --git a/tests/serializers/test_deserialization.py b/tests/serializers/test_deserialization.py +index a718a99038..8c9296e1a7 100644 +--- a/tests/serializers/test_deserialization.py ++++ b/tests/serializers/test_deserialization.py +@@ -138,6 +138,7 @@ class TestDeserializer(SimpleTestCase): + self.assertEqual(first_item.object, self.jane) + self.assertEqual(second_item.object, self.joe) + ++ @unittest.skip("flaky") + def test_crafted_xml_performance(self): + """The time to process invalid inputs is not quadratic.""" + diff --git a/pkgs/development/python-modules/django/6.nix b/pkgs/development/python-modules/django/6.nix index bf4f64be7887..1bf6ff170394 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.8"; + version = "6.1.1"; pyproject = true; disabled = pythonOlder "3.12"; @@ -51,7 +51,7 @@ buildPythonPackage (finalAttrs: { owner = "django"; repo = "django"; tag = finalAttrs.version; - hash = "sha256-hQQMKa8YirrTAoCrW1nn3RqRXv0szLgeSOjeKxBfiSo="; + hash = "sha256-jOshsS3ceWEJoxOuyUSEJvIPE5LLMrzMXEhVgX6wDPQ="; }; patches = [ @@ -62,8 +62,6 @@ buildPythonPackage (finalAttrs: { ./6.x/pythonpath.patch # test_incorrect_timezone should raise but doesn't ./6.x/disable-failing-test.patch - # some perf tests are often flaky under pressure - ./6.x/skip-flaky-tests.patch # https://code.djangoproject.com/ticket/36997 # https://github.com/django/django/pull/21019 ./6.x/invalidate-importlib-cache.patch diff --git a/pkgs/development/python-modules/django/6.x/skip-flaky-tests.patch b/pkgs/development/python-modules/django/6.x/skip-flaky-tests.patch index e9f3dda965be..7753f904a445 100644 --- a/pkgs/development/python-modules/django/6.x/skip-flaky-tests.patch +++ b/pkgs/development/python-modules/django/6.x/skip-flaky-tests.patch @@ -1,12 +1,12 @@ diff --git a/tests/serializers/test_deserialization.py b/tests/serializers/test_deserialization.py -index a718a99038..8c9296e1a7 100644 +index f4be93957a..a4556134af 100644 --- a/tests/serializers/test_deserialization.py +++ b/tests/serializers/test_deserialization.py -@@ -138,6 +138,7 @@ class TestDeserializer(SimpleTestCase): +@@ -137,6 +137,7 @@ class TestDeserializer(SimpleTestCase): self.assertEqual(first_item.object, self.jane) self.assertEqual(second_item.object, self.joe) + @unittest.skip("flaky") - def test_crafted_xml_performance(self): - """The time to process invalid inputs is not quadratic.""" - + def test_crafted_xml_rejected(self): + depth = 100 + leaf_text_len = 1000 diff --git a/pkgs/development/python-modules/django/6_0.nix b/pkgs/development/python-modules/django/6_0.nix new file mode 100644 index 000000000000..9c28d53b96f1 --- /dev/null +++ b/pkgs/development/python-modules/django/6_0.nix @@ -0,0 +1,147 @@ +{ + lib, + stdenv, + buildPythonPackage, + fetchFromGitHub, + pythonOlder, + replaceVars, + + # build-system + setuptools, + + # patched in + geos, + gdal, + withGdal ? false, + + # dependencies + asgiref, + sqlparse, + + # optional-dependencies + argon2-cffi, + bcrypt, + + # tests + aiosmtpd, + docutils, + geoip2, + jinja2, + numpy, + pillow, + pylibmc, + pymemcache, + python, + pyyaml, + pytz, + redis, + selenium, + tblib, + tzdata, +}: + +buildPythonPackage (finalAttrs: { + pname = "django"; + version = "6.0.8"; + pyproject = true; + + disabled = pythonOlder "3.12"; + + src = fetchFromGitHub { + owner = "django"; + repo = "django"; + tag = finalAttrs.version; + hash = "sha256-hQQMKa8YirrTAoCrW1nn3RqRXv0szLgeSOjeKxBfiSo="; + }; + + patches = [ + (replaceVars ./6.x/zoneinfo.patch { + zoneinfo = tzdata + "/share/zoneinfo"; + }) + # prevent tests from messing with our pythonpath + ./6.x/pythonpath.patch + # test_incorrect_timezone should raise but doesn't + ./6.x/disable-failing-test.patch + # some perf tests are often flaky under pressure + ./6.0/skip-flaky-tests.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 { + geos = geos; + gdal = gdal; + extension = stdenv.hostPlatform.extensions.sharedLibrary; + }) + ]; + + postPatch = '' + substituteInPlace tests/utils_tests/test_autoreload.py \ + --replace-fail "/usr/bin/python" "${python.interpreter}" + ''; + + build-system = [ setuptools ]; + + dependencies = [ + asgiref + sqlparse + ]; + + optional-dependencies = { + argon2 = [ argon2-cffi ]; + bcrypt = [ bcrypt ]; + }; + + nativeCheckInputs = [ + # tests/requirements/py3.txt + aiosmtpd + docutils + geoip2 + jinja2 + numpy + pillow + pylibmc + pymemcache + pyyaml + pytz + redis + selenium + tblib + tzdata + ] + ++ lib.concatAttrValues finalAttrs.passthru.optional-dependencies; + + preCheck = '' + # make sure the installed library gets imported + rm -rf django + + # fails to import github_links from docs/_ext/github_links.py + rm tests/sphinx/test_github_links.py + + # provide timezone data, works only on linux + export TZDIR=${tzdata}/${python.sitePackages}/tzdata/zoneinfo + + export PYTHONPATH=$PWD/docs/_ext:$PYTHONPATH + ''; + + checkPhase = '' + runHook preCheck + + pushd tests + ${python.interpreter} runtests.py --settings=test_sqlite --parallel=$NIX_BUILD_CORES + popd + + runHook postCheck + ''; + + __darwinAllowLocalNetworking = true; + + meta = with lib; { + changelog = "https://docs.djangoproject.com/en/${lib.versions.majorMinor finalAttrs.version}/releases/${finalAttrs.version}/"; + description = "High-level Python Web framework that encourages rapid development and clean, pragmatic design"; + homepage = "https://www.djangoproject.com"; + license = licenses.bsd3; + maintainers = with maintainers; [ hexa ]; + }; +}) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index f26aea5146bf..6ab9d797b1bf 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -4956,6 +4956,8 @@ self: super: with self; { django_6 = callPackage ../development/python-modules/django/6.nix { }; + django_6_0 = callPackage ../development/python-modules/django/6_0.nix { }; + djangocms-admin-style = callPackage ../development/python-modules/djangocms-admin-style { }; djangocms-alias = callPackage ../development/python-modules/djangocms-alias { }; From 1413f638ec2aa33f35726ee458661c9692eb3403 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Fri, 25 Sep 2026 23:26:14 +0200 Subject: [PATCH 02/17] python3Packages.djangorestframework_3_17: init at 3.17.1 --- .../djangorestframework/3_17.nix | 78 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 4 + 2 files changed, 82 insertions(+) create mode 100644 pkgs/development/python-modules/djangorestframework/3_17.nix diff --git a/pkgs/development/python-modules/djangorestframework/3_17.nix b/pkgs/development/python-modules/djangorestframework/3_17.nix new file mode 100644 index 000000000000..b915ae89d2f9 --- /dev/null +++ b/pkgs/development/python-modules/djangorestframework/3_17.nix @@ -0,0 +1,78 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + pythonOlder, + + # build-system + setuptools, + + # dependencies + django, + + # optional-dependencies + coreapi, + coreschema, + django-guardian, + inflection, + psycopg2, + pygments, + pyyaml, + + # tests + pytestCheckHook, + pytest-django, + pytz, +}: + +buildPythonPackage (finalAttrs: { + pname = "djangorestframework"; + version = "3.17.1"; + pyproject = true; + + src = fetchFromGitHub { + owner = "encode"; + repo = "django-rest-framework"; + tag = finalAttrs.version; + hash = "sha256-hDAtICtVFeEXRgR5Shb0IdVlLkpf/TBDWw+2cOLJTfw="; + }; + + build-system = [ setuptools ]; + + dependencies = [ + django + ]; + + optional-dependencies = { + complete = [ + coreapi + coreschema + django-guardian + inflection + psycopg2 + pygments + pyyaml + ]; + }; + + nativeCheckInputs = [ + pytest-django + pytestCheckHook + pytz + ] + ++ finalAttrs.passthru.optional-dependencies.complete; + + disabledTests = [ + # https://github.com/encode/django-rest-framework/issues/9422 + "test_urlpatterns" + ]; + + pythonImportsCheck = [ "rest_framework" ]; + + meta = { + changelog = "https://github.com/encode/django-rest-framework/releases/tag/${finalAttrs.src.tag}"; + description = "Web APIs for Django, made easy"; + homepage = "https://www.django-rest-framework.org/"; + license = lib.licenses.bsd2; + }; +}) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 6ab9d797b1bf..d61c14f995ef 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -4998,6 +4998,10 @@ self: super: with self; { djangorestframework-stubs = callPackage ../development/python-modules/djangorestframework-stubs { }; + djangorestframework_3_17 = + callPackage ../development/python-modules/djangorestframework/3_17.nix + { }; + djangosaml2 = callPackage ../development/python-modules/djangosaml2 { }; djmail = callPackage ../development/python-modules/djmail { }; From dcaf625d88e133c47bb78d646e020e7fa2291f61 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sat, 26 Sep 2026 01:37:31 +0200 Subject: [PATCH 03/17] python3Packages.django-ninja: 1.6.2 -> 1.7.1 https://github.com/vitalik/django-ninja/releases/tag/v1.6.3 https://github.com/vitalik/django-ninja/releases/tag/v1.7.0 https://github.com/vitalik/django-ninja/releases/tag/v1.7.1 --- pkgs/development/python-modules/django-ninja/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/django-ninja/default.nix b/pkgs/development/python-modules/django-ninja/default.nix index 54c1be0159ff..13caa6338943 100644 --- a/pkgs/development/python-modules/django-ninja/default.nix +++ b/pkgs/development/python-modules/django-ninja/default.nix @@ -13,14 +13,14 @@ buildPythonPackage rec { pname = "django-ninja"; - version = "1.6.2"; + version = "1.7.1"; pyproject = true; src = fetchFromGitHub { owner = "vitalik"; repo = "django-ninja"; tag = "v${version}"; - hash = "sha256-nnGIhNGnK7q0nbw7EYJP+xCeS1uiuTrhQxf49dA+Sc8="; + hash = "sha256-/KsFq6LgaRMxMHmWO5vuzeVZTsmnERTbuS2ne4jc6eA="; }; build-system = [ flit-core ]; From ec860401bb61acfece186cfcbd6c8aad2acdf980 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sat, 8 Aug 2026 23:36:49 +0200 Subject: [PATCH 04/17] python3Packages.djangorestframework: 3.17.1 -> 3.18.1 https://github.com/encode/django-rest-framework/releases/tag/3.18.0 https://github.com/encode/django-rest-framework/releases/tag/3.18.1 --- .../python-modules/djangorestframework/default.nix | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/pkgs/development/python-modules/djangorestframework/default.nix b/pkgs/development/python-modules/djangorestframework/default.nix index b915ae89d2f9..32cc7104d79c 100644 --- a/pkgs/development/python-modules/djangorestframework/default.nix +++ b/pkgs/development/python-modules/djangorestframework/default.nix @@ -2,7 +2,6 @@ lib, buildPythonPackage, fetchFromGitHub, - pythonOlder, # build-system setuptools, @@ -20,6 +19,7 @@ pyyaml, # tests + dj-database-url, pytestCheckHook, pytest-django, pytz, @@ -27,14 +27,14 @@ buildPythonPackage (finalAttrs: { pname = "djangorestframework"; - version = "3.17.1"; + version = "3.18.1"; pyproject = true; src = fetchFromGitHub { owner = "encode"; repo = "django-rest-framework"; tag = finalAttrs.version; - hash = "sha256-hDAtICtVFeEXRgR5Shb0IdVlLkpf/TBDWw+2cOLJTfw="; + hash = "sha256-ZOzGJOIyN6X7NxplIDUeII87IlsXViNLPeW7f4/vIfY="; }; build-system = [ setuptools ]; @@ -56,17 +56,13 @@ buildPythonPackage (finalAttrs: { }; nativeCheckInputs = [ + dj-database-url pytest-django pytestCheckHook pytz ] ++ finalAttrs.passthru.optional-dependencies.complete; - disabledTests = [ - # https://github.com/encode/django-rest-framework/issues/9422 - "test_urlpatterns" - ]; - pythonImportsCheck = [ "rest_framework" ]; meta = { From f94549214574b870186113d09389a6de8ddbb4f7 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sun, 9 Aug 2026 00:26:02 +0200 Subject: [PATCH 05/17] python3Packages.django-formtools: disable failing test --- .../python-modules/django-formtools/default.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/django-formtools/default.nix b/pkgs/development/python-modules/django-formtools/default.nix index a5e1c9ad8304..653ec7e7fc6e 100644 --- a/pkgs/development/python-modules/django-formtools/default.nix +++ b/pkgs/development/python-modules/django-formtools/default.nix @@ -40,9 +40,10 @@ buildPythonPackage (finalAttrs: { 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" + ] + ++ lib.optionals (lib.versionAtLeast django.version "6.1") [ + # https://github.com/jazzband/django-formtools/issues/303 + "test_manipulated_cookie" ]; pythonImportsCheck = [ "formtools" ]; From d93afa1b7628c5b421e7b28ce678c82f80a3b9c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Sun, 23 Aug 2026 11:08:41 +0200 Subject: [PATCH 06/17] python3Packages.django-async-backend: 6.0.7 -> 6.1.2 Somehow pytest-django is not running migration and causing some test failures. The package can be build with glitchtip.python.pkgs.django-async-backend Diff: https://github.com/Arfey/django-async-backend/compare/v6.0.7...v6.1.2 Changelog: https://github.com/Arfey/django-async-backend/releases/tag/v6.0.8 Changelog: https://github.com/Arfey/django-async-backend/releases/tag/v6.0.9 Changelog: https://github.com/Arfey/django-async-backend/releases/tag/v6.1.0 Changelog: https://github.com/Arfey/django-async-backend/releases/tag/v6.1.1 Changelog: https://github.com/Arfey/django-async-backend/releases/tag/v6.1.2 --- .../django-async-backend/default.nix | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/pkgs/development/python-modules/django-async-backend/default.nix b/pkgs/development/python-modules/django-async-backend/default.nix index 404ecff96939..63d8fd4ee26f 100644 --- a/pkgs/development/python-modules/django-async-backend/default.nix +++ b/pkgs/development/python-modules/django-async-backend/default.nix @@ -3,6 +3,7 @@ buildPythonPackage, django, fetchFromGitHub, + libcst, poetry-core, postgresql, postgresqlTestHook, @@ -14,14 +15,14 @@ buildPythonPackage rec { pname = "django-async-backend"; - version = "6.0.7"; + version = "6.1.2"; pyproject = true; src = fetchFromGitHub { owner = "Arfey"; repo = "django-async-backend"; tag = "v${version}"; - hash = "sha256-4zaXPfHIE9RwkSbHPt1DHFInn8LP+JXiBiMJYkZeR6M="; + hash = "sha256-pfcqTtyV37bZFSZaRcFIt9cgR8XZ7PDijVC18lMziRU="; }; postPatch = '' @@ -47,24 +48,26 @@ buildPythonPackage rec { PGUSER = "postgres"; }; - preCheck = '' - export PYTHONPATH=$PYTHONPATH:$PWD/tests + checkPhase = '' + runHook preCheck + + cd tests/ + python manage.py test + + runHook postCheck ''; nativeCheckInputs = [ django # must come first as vtasks only works with django 6 + libcst postgresql postgresqlTestHook psycopg-pool - pytest-django - pytestCheckHook ]; - pytestFlags = [ "./tests" ]; - meta = { - description = "Django extension providing async capabilities for database and other components"; + description = "True async Django ORM and PostgreSQL backend with connection pooling and async transactions"; homepage = "https://github.com/Arfey/django-async-backend"; changelog = "https://github.com/Arfey/django-async-backend/releases/tag/${src.tag}"; license = lib.licenses.asl20; From 377a2ea04b4b32cace40bacf69a30b109cdd0415 Mon Sep 17 00:00:00 2001 From: Minijackson Date: Tue, 15 Sep 2026 09:02:36 +0200 Subject: [PATCH 07/17] python3Packages.strawberry-graphql-django: remove django-mptt dependency It doesn't seems used anymore --- .../python-modules/strawberry-graphql-django/default.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/pkgs/development/python-modules/strawberry-graphql-django/default.nix b/pkgs/development/python-modules/strawberry-graphql-django/default.nix index 305a82c01bd8..b5ffc13b5fc8 100644 --- a/pkgs/development/python-modules/strawberry-graphql-django/default.nix +++ b/pkgs/development/python-modules/strawberry-graphql-django/default.nix @@ -20,7 +20,6 @@ pytestCheckHook, django-guardian, django-model-utils, - django-mptt, django-polymorphic, django-tree-queries, factory-boy, @@ -74,7 +73,6 @@ buildPythonPackage rec { django-guardian django-model-utils - django-mptt django-polymorphic django-tree-queries factory-boy From c34b588fd5648ff6999235543d102de476a087fd Mon Sep 17 00:00:00 2001 From: Minijackson Date: Tue, 15 Sep 2026 09:03:04 +0200 Subject: [PATCH 08/17] python3Packages.django-guardian: 3.3.3 -> 3.5.0 Upgrade past 3.4.0 required to for Django 6.1. https://github.com/django-guardian/django-guardian/releases/tag/3.3.4 https://github.com/django-guardian/django-guardian/releases/tag/3.4.0 https://github.com/django-guardian/django-guardian/releases/tag/3.4.1 https://github.com/django-guardian/django-guardian/releases/tag/3.5.0 --- pkgs/development/python-modules/django-guardian/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/django-guardian/default.nix b/pkgs/development/python-modules/django-guardian/default.nix index 3103f6f116a1..f94b38ccb680 100644 --- a/pkgs/development/python-modules/django-guardian/default.nix +++ b/pkgs/development/python-modules/django-guardian/default.nix @@ -12,14 +12,14 @@ buildPythonPackage (finalAttrs: { pname = "django-guardian"; - version = "3.3.3"; + version = "3.5.0"; pyproject = true; src = fetchFromGitHub { owner = "django-guardian"; repo = "django-guardian"; tag = finalAttrs.version; - hash = "sha256-0zUdcDeJ40AuYSzhjy3/htU43cy6T54rZOj2zFo6J+8="; + hash = "sha256-viqICF6zfJxAj1jEYtBXCR2NbUR26Q8SeKVFTMVzisQ="; }; build-system = [ setuptools ]; From d0001b3f9eff2956bba6c74c4d49b18b85f03b20 Mon Sep 17 00:00:00 2001 From: Minijackson Date: Tue, 15 Sep 2026 09:03:38 +0200 Subject: [PATCH 09/17] python3Packages.django-debug-toolbar: 7.0.0 -> 8.0.0 Needed to upgrade to Django 6.1 --- .../python-modules/django-debug-toolbar/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/django-debug-toolbar/default.nix b/pkgs/development/python-modules/django-debug-toolbar/default.nix index 8137ea09057f..b9e76e9d78d1 100644 --- a/pkgs/development/python-modules/django-debug-toolbar/default.nix +++ b/pkgs/development/python-modules/django-debug-toolbar/default.nix @@ -19,14 +19,14 @@ buildPythonPackage rec { pname = "django-debug-toolbar"; - version = "7.0.0"; + version = "8.0.0"; pyproject = true; src = fetchFromGitHub { owner = "jazzband"; repo = "django-debug-toolbar"; tag = version; - hash = "sha256-Xwl6LsNW3/VXJ59QaW4l6D+8VEbl45ysv5KaySbS4M4="; + hash = "sha256-OwMul+wGKLU9LwybsCtqV51lp/CQvexP0TWJSg8E3iQ="; }; postPatch = '' From 1c0e708fef84c8e8114e1f0197f7ebf0e7eacded Mon Sep 17 00:00:00 2001 From: Minijackson Date: Tue, 15 Sep 2026 09:03:58 +0200 Subject: [PATCH 10/17] python3Packages.django-mptt: disable tests when using Django 6 The tests seem to only fail due to HTML differences. --- pkgs/development/python-modules/django-mptt/default.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/development/python-modules/django-mptt/default.nix b/pkgs/development/python-modules/django-mptt/default.nix index 50cda6412332..e2f03a59e8f4 100644 --- a/pkgs/development/python-modules/django-mptt/default.nix +++ b/pkgs/development/python-modules/django-mptt/default.nix @@ -37,6 +37,9 @@ buildPythonPackage rec { pytest-django ]; + # XXX: some HTML tests fail with Django 6.1+ + doCheck = lib.versionOlder django.version "6.1"; + preCheck = '' export DJANGO_SETTINGS_MODULE=tests.settings export PYTHONPATH=$(pwd)/tests:$PYTHONPATH From 5a39c8bdf1cdafb311c18218a84fa6de31191fe8 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sat, 26 Sep 2026 12:28:06 +0200 Subject: [PATCH 11/17] python3Packages.drf-spectacular: update test setup --- pkgs/development/python-modules/drf-spectacular/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/drf-spectacular/default.nix b/pkgs/development/python-modules/drf-spectacular/default.nix index 3afbf1cc7263..b9378cf2fc69 100644 --- a/pkgs/development/python-modules/drf-spectacular/default.nix +++ b/pkgs/development/python-modules/drf-spectacular/default.nix @@ -8,6 +8,7 @@ django-oauth-toolkit, django-polymorphic, django-rest-auth, + django-rest-knox, django-rest-polymorphic, djangorestframework, djangorestframework-camel-case, @@ -60,6 +61,7 @@ buildPythonPackage rec { django-oauth-toolkit django-polymorphic django-rest-auth + django-rest-knox django-rest-polymorphic djangorestframework-camel-case djangorestframework-dataclasses @@ -77,8 +79,6 @@ buildPythonPackage rec { disabledTestPaths = [ # django-oauth-toolkit 3.4.1 added a new error that the example application has "tests/test_command.py::test_command_check" - # django-rest-knox is not packaged - "tests/contrib/test_knox_auth_token.py" # Outdated test artifact "tests/contrib/test_pydantic.py" # Test requires django with gdal From 68550897064df95f051c224b8f889b38d3303d93 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sat, 26 Sep 2026 13:50:18 +0200 Subject: [PATCH 12/17] python3Packages.drf-spectacular: disable failing tests --- pkgs/development/python-modules/drf-spectacular/default.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/development/python-modules/drf-spectacular/default.nix b/pkgs/development/python-modules/drf-spectacular/default.nix index b9378cf2fc69..60c49e8182a2 100644 --- a/pkgs/development/python-modules/drf-spectacular/default.nix +++ b/pkgs/development/python-modules/drf-spectacular/default.nix @@ -83,6 +83,9 @@ buildPythonPackage rec { "tests/contrib/test_pydantic.py" # Test requires django with gdal "tests/contrib/test_rest_framework_gis.py" + # OpenAPI schema failure with DRF 3.18.x + "tests/test_fields.py::test_fields" + "tests/test_fields.py::test_fields_oas_3_1" ]; pythonImportsCheck = [ "drf_spectacular" ]; From be25580448474463a930a6c7a3f378a18b92ff9c Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sat, 26 Sep 2026 13:56:36 +0200 Subject: [PATCH 13/17] pretalx: pin django 6.0 --- pkgs/by-name/pr/pretalx/package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/pr/pretalx/package.nix b/pkgs/by-name/pr/pretalx/package.nix index 8edf195f9177..269d88566812 100644 --- a/pkgs/by-name/pr/pretalx/package.nix +++ b/pkgs/by-name/pr/pretalx/package.nix @@ -14,7 +14,7 @@ let python = python314.override { self = python; packageOverrides = final: prev: { - django = prev.django_6; + django = prev.django_6_0; django-hierarkey = prev.django-hierarkey.overrideAttrs (oldAttrs: { version = "2.0.1"; From 9eb52abbb0ae0deccacacbc992b533339ecc1f00 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sat, 26 Sep 2026 14:05:04 +0200 Subject: [PATCH 14/17] pretix: pin drf at 3.17.x --- pkgs/by-name/pr/pretix/package.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/by-name/pr/pretix/package.nix b/pkgs/by-name/pr/pretix/package.nix index 117a5e877b7c..9bc17d212b33 100644 --- a/pkgs/by-name/pr/pretix/package.nix +++ b/pkgs/by-name/pr/pretix/package.nix @@ -19,6 +19,7 @@ let packageOverrides = self: super: { chardet = super.chardet_5; django = super.django_5; + djangorestframework = super.djangorestframework_3_17; django-oauth-toolkit = super.django-oauth-toolkit.overridePythonAttrs (oldAttrs: rec { version = "2.3.0"; From 67c2b1206a20843fe6833b707dfed9eacda41e3f Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sat, 26 Sep 2026 14:19:58 +0200 Subject: [PATCH 15/17] paperless-ngx: relax django-guardian constraint --- pkgs/by-name/pa/paperless-ngx/package.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/by-name/pa/paperless-ngx/package.nix b/pkgs/by-name/pa/paperless-ngx/package.nix index c7c61af3083a..ff56e114cbfc 100644 --- a/pkgs/by-name/pa/paperless-ngx/package.nix +++ b/pkgs/by-name/pa/paperless-ngx/package.nix @@ -96,6 +96,7 @@ pythonPackages.buildPythonApplication (finalAttrs: { pythonRelaxDeps = [ "django-allauth" "django-filter" + "django-guardian" "drf-spectacular-sidecar" "redis" "regex" From b91eccd4a31730f5112b7c8c0307ab91de06898e Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sat, 26 Sep 2026 16:31:39 +0200 Subject: [PATCH 16/17] weblate: pin django at 6.0.x --- pkgs/by-name/we/weblate/package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/we/weblate/package.nix b/pkgs/by-name/we/weblate/package.nix index fd826bca0ec9..4c4efe191349 100644 --- a/pkgs/by-name/we/weblate/package.nix +++ b/pkgs/by-name/we/weblate/package.nix @@ -28,7 +28,7 @@ let python = python3.override { self = python; packageOverrides = _final: prev: { - django = prev.django_6; + django = prev.django_6_0; }; }; python3Packages = python.pkgs; From 9d6614ba99bab322b0272f001403ea179df286e4 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sat, 26 Sep 2026 16:58:52 +0200 Subject: [PATCH 17/17] python3Packages.django*: add cpe and purl identifiers --- pkgs/development/python-modules/django/5.nix | 22 ++++++++++++++----- pkgs/development/python-modules/django/6.nix | 12 ++++++++++ .../development/python-modules/django/6_0.nix | 12 ++++++++++ 3 files changed, 41 insertions(+), 5 deletions(-) diff --git a/pkgs/development/python-modules/django/5.nix b/pkgs/development/python-modules/django/5.nix index d9ec648838c7..8d37a45947ac 100644 --- a/pkgs/development/python-modules/django/5.nix +++ b/pkgs/development/python-modules/django/5.nix @@ -39,7 +39,7 @@ tzdata, }: -buildPythonPackage rec { +buildPythonPackage (finalAttrs: { pname = "django"; version = "5.2.17"; pyproject = true; @@ -47,7 +47,7 @@ buildPythonPackage rec { src = fetchFromGitHub { owner = "django"; repo = "django"; - tag = version; + tag = finalAttrs.version; hash = "sha256-7it3opzsiN/hHhpipZz4ogmRKGz7E9/LmTF03/UYIB0="; }; @@ -102,7 +102,7 @@ buildPythonPackage rec { tblib tzdata ] - ++ lib.concatAttrValues optional-dependencies; + ++ lib.concatAttrValues finalAttrs.passthru.optional-dependencies; preCheck = '' # make sure the installed library gets imported @@ -131,10 +131,22 @@ buildPythonPackage rec { __darwinAllowLocalNetworking = true; meta = { - changelog = "https://docs.djangoproject.com/en/${lib.versions.majorMinor version}/releases/${version}/"; + changelog = "https://docs.djangoproject.com/en/${lib.versions.majorMinor finalAttrs.version}/releases/${finalAttrs.version}/"; description = "High-level Python Web framework that encourages rapid development and clean, pragmatic design"; homepage = "https://www.djangoproject.com"; + identifiers = { + cpeParts = { + inherit (finalAttrs) version; + product = "django"; + update = "*"; + vendor = "djangoproject"; + }; + purlParts = { + type = "pypi"; + spec = "django@${finalAttrs.version}"; + }; + }; license = lib.licenses.bsd3; maintainers = with lib.maintainers; [ hexa ]; }; -} +}) diff --git a/pkgs/development/python-modules/django/6.nix b/pkgs/development/python-modules/django/6.nix index 1bf6ff170394..472c5d7fa3ff 100644 --- a/pkgs/development/python-modules/django/6.nix +++ b/pkgs/development/python-modules/django/6.nix @@ -139,6 +139,18 @@ buildPythonPackage (finalAttrs: { changelog = "https://docs.djangoproject.com/en/${lib.versions.majorMinor finalAttrs.version}/releases/${finalAttrs.version}/"; description = "High-level Python Web framework that encourages rapid development and clean, pragmatic design"; homepage = "https://www.djangoproject.com"; + identifiers = { + cpeParts = { + inherit (finalAttrs) version; + product = "django"; + update = "*"; + vendor = "djangoproject"; + }; + purlParts = { + type = "pypi"; + spec = "django@${finalAttrs.version}"; + }; + }; license = licenses.bsd3; maintainers = with maintainers; [ hexa ]; }; diff --git a/pkgs/development/python-modules/django/6_0.nix b/pkgs/development/python-modules/django/6_0.nix index 9c28d53b96f1..58cd89174997 100644 --- a/pkgs/development/python-modules/django/6_0.nix +++ b/pkgs/development/python-modules/django/6_0.nix @@ -141,6 +141,18 @@ buildPythonPackage (finalAttrs: { changelog = "https://docs.djangoproject.com/en/${lib.versions.majorMinor finalAttrs.version}/releases/${finalAttrs.version}/"; description = "High-level Python Web framework that encourages rapid development and clean, pragmatic design"; homepage = "https://www.djangoproject.com"; + identifiers = { + cpeParts = { + inherit (finalAttrs) version; + product = "django"; + update = "*"; + vendor = "djangoproject"; + }; + purlParts = { + type = "pypi"; + spec = "django@${finalAttrs.version}"; + }; + }; license = licenses.bsd3; maintainers = with maintainers; [ hexa ]; };