python3Packages.django_6: 6.0.8 -> 6.1 (#550626)

This commit is contained in:
Martin Weinelt
2026-09-26 15:06:04 +00:00
committed by GitHub
20 changed files with 329 additions and 46 deletions

View File

@@ -96,6 +96,7 @@ pythonPackages.buildPythonApplication (finalAttrs: {
pythonRelaxDeps = [
"django-allauth"
"django-filter"
"django-guardian"
"drf-spectacular-sidecar"
"redis"
"regex"

View File

@@ -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";

View File

@@ -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";

View File

@@ -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;

View File

@@ -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;

View File

@@ -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 = ''

View File

@@ -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" ];

View File

@@ -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 ];

View File

@@ -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

View File

@@ -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 ];

View File

@@ -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 ];
};
}
})

View File

@@ -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."""

View File

@@ -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
@@ -141,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 ];
};

View File

@@ -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

View File

@@ -0,0 +1,159 @@
{
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";
identifiers = {
cpeParts = {
inherit (finalAttrs) version;
product = "django";
update = "*";
vendor = "djangoproject";
};
purlParts = {
type = "pypi";
spec = "django@${finalAttrs.version}";
};
};
license = licenses.bsd3;
maintainers = with maintainers; [ hexa ];
};
})

View File

@@ -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;
};
})

View File

@@ -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 = {

View File

@@ -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,12 +79,13 @@ 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
"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" ];

View File

@@ -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

View File

@@ -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 { };
@@ -4996,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 { };