From f699824f6e0525ec3873fefa557ee49a18478ed4 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Tue, 25 Jul 2023 22:14:59 +0200 Subject: [PATCH 01/19] python310Packages.django: migrate to django_4 3.2 LTS ran out of mainstream support in 2021/12 and we should probably stay on the latest LTS release, that receives mainstream support. --- nixos/doc/manual/release-notes/rl-2311.section.md | 12 ++++++++++++ pkgs/top-level/python-packages.nix | 7 +++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/nixos/doc/manual/release-notes/rl-2311.section.md b/nixos/doc/manual/release-notes/rl-2311.section.md index 80b2066582a3..3d82c4a7beb8 100644 --- a/nixos/doc/manual/release-notes/rl-2311.section.md +++ b/nixos/doc/manual/release-notes/rl-2311.section.md @@ -158,6 +158,18 @@ The module update takes care of the new config syntax and the data itself (user ## Nixpkgs internals {#sec-release-23.11-nixpkgs-internals} +- The `django` alias in the python package set was upgraded to Django 4.x. + Applications that consume Django should always pin their python environment + to a compatible major version, so they can move at their own pace. + + ```nix + python = python3.override { + packageOverrides = self: super: { + django = super.django_3; + }; + }; + ``` + - The `qemu-vm.nix` module by default now identifies block devices via persistent names available in `/dev/disk/by-*`. Because the rootDevice is identfied by its filesystem label, it needs to be formatted before the VM is diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 83b45cde21b3..cda5a120314a 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2727,12 +2727,11 @@ self: super: with self; { distutils_extra = callPackage ../development/python-modules/distutils_extra { }; - django = self.django_3; - - # Current LTS + # LTS in extended support phase django_3 = callPackage ../development/python-modules/django/3.nix { }; - # Current latest + # LTS with mainsteam support + django = self.django_4; django_4 = callPackage ../development/python-modules/django/4.nix { }; django-admin-datta = callPackage ../development/python-modules/django-admin-datta { }; From 27b8b774748938d727895fb8b3d3a534707b545a Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Tue, 25 Jul 2023 23:07:48 +0200 Subject: [PATCH 02/19] python310Packages.django-scim2: 0.17.3 -> 0.19.0 https://github.com/15five/django-scim2/blob/refs/tags/0.19.0/CHANGES.txt --- .../python-modules/django-scim2/default.nix | 31 ++++++++++++------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/pkgs/development/python-modules/django-scim2/default.nix b/pkgs/development/python-modules/django-scim2/default.nix index 90db4fe633d3..536d851a4099 100644 --- a/pkgs/development/python-modules/django-scim2/default.nix +++ b/pkgs/development/python-modules/django-scim2/default.nix @@ -2,37 +2,43 @@ , buildPythonPackage , fetchFromGitHub +# build-system +, poetry-core + # propagates , django -, python-dateutil , scim2-filter-parser -, gssapi -, python-ldap -, sssd # tests , mock +, pytest-django +, pytestCheckHook }: buildPythonPackage rec { pname = "django-scim2"; - version = "0.17.3"; - format = "setuptools"; + version = "0.19.0"; + format = "pyproject"; src = fetchFromGitHub { owner = "15five"; repo = pname; rev = "refs/tags/${version}"; - hash = "sha256-5zdGPpjooiFoj+2OoglXhhKsPFB/KOHvrZWZd+1nZqU="; + hash = "sha256-larDh4f9/xVr11/n/WfkJ2Tx45DMQqyK3ZzkWAvzeig="; }; + postPatch = '' + substituteInPlace pyproject.toml \ + --replace "poetry.masonry.api" "poetry.core.masonry.api" + ''; + + nativeBuildInputs = [ + poetry-core + ]; + propagatedBuildInputs = [ django - python-dateutil scim2-filter-parser - gssapi - python-ldap - sssd ]; pythonImportsCheck = [ @@ -41,9 +47,12 @@ buildPythonPackage rec { nativeCheckInputs = [ mock + pytest-django + pytestCheckHook ]; meta = with lib; { + changelog = "https://github.com/15five/django-scim2/blob/${src.rev}/CHANGES.txt"; description = "A SCIM 2.0 Service Provider Implementation (for Django)"; homepage = "https://github.com/15five/django-scim2"; license = licenses.mit; From 79105aad78e10f7bffc0cdace35ca5b0d6bdf324 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Wed, 26 Jul 2023 00:08:53 +0200 Subject: [PATCH 03/19] python310Packages.django-cachalot: 2.5.3 -> 2.6.1 https://github.com/noripyt/django-cachalot/blob/v2.6.1/CHANGELOG.rst --- pkgs/development/python-modules/django-cachalot/default.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/django-cachalot/default.nix b/pkgs/development/python-modules/django-cachalot/default.nix index f52a3aa46e62..33d9e484f114 100644 --- a/pkgs/development/python-modules/django-cachalot/default.nix +++ b/pkgs/development/python-modules/django-cachalot/default.nix @@ -6,18 +6,19 @@ , psycopg2 , beautifulsoup4 , python +, pytz }: buildPythonPackage rec { pname = "django-cachalot"; - version = "2.5.3"; + version = "2.6.1"; format = "setuptools"; src = fetchFromGitHub { owner = "noripyt"; repo = "django-cachalot"; rev = "v${version}"; - hash = "sha256-ayAN+PgK3aIpt4R8aeC6c6mRGTnfObycmkoXPTjx4WI="; + hash = "sha256-bCiIZkh02+7xL6aSWE9by+4dFDsanr0iXuO9QKpLOjw="; }; patches = [ @@ -34,6 +35,7 @@ buildPythonPackage rec { beautifulsoup4 django-debug-toolbar psycopg2 + pytz ]; pythonImportsCheck = [ "cachalot" ]; From 0116a04d7b64299bf64dfdc50afb3d58ebb2bbfa Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Wed, 26 Jul 2023 00:27:44 +0200 Subject: [PATCH 04/19] python310Packages.django-mailman: fix build --- .../django-mailman3/default.nix | 45 ++++++++++++++----- 1 file changed, 34 insertions(+), 11 deletions(-) diff --git a/pkgs/development/python-modules/django-mailman3/default.nix b/pkgs/development/python-modules/django-mailman3/default.nix index 32bfe947c82f..6639257740bc 100644 --- a/pkgs/development/python-modules/django-mailman3/default.nix +++ b/pkgs/development/python-modules/django-mailman3/default.nix @@ -1,27 +1,50 @@ -{ lib, buildPythonPackage, fetchPypi, django-gravatar2, django-compressor -, django-allauth, mailmanclient, django, mock +{ lib +, buildPythonPackage +, fetchPypi + +# propagates +, django-gravatar2 +, django-allauth +, mailmanclient +, pytz + +# tests +, django +, pytest-django +, pytestCheckHook }: buildPythonPackage rec { pname = "django-mailman3"; version = "1.3.9"; + format = "setuptools"; src = fetchPypi { inherit pname version; hash = "sha256-GpI1W0O9aJpLF/mcS23ktJDZsP69S2zQy7drOiWBnTM="; }; - propagatedBuildInputs = [ - django-gravatar2 django-compressor django-allauth mailmanclient - ]; - nativeCheckInputs = [ django mock ]; - - checkPhase = '' - cd $NIX_BUILD_TOP/$sourceRoot - PYTHONPATH=.:$PYTHONPATH django-admin.py test --settings=django_mailman3.tests.settings_test + postPatch = '' + substituteInPlace setup.py \ + --replace 'django>=3.2,<4.2' 'django>=3.2,<4.3' ''; - pythonImportsCheck = [ "django_mailman3" ]; + propagatedBuildInputs = [ + django-allauth + django-gravatar2 + mailmanclient + pytz + ]; + + nativeCheckInputs = [ + django + pytest-django + pytestCheckHook + ]; + + pythonImportsCheck = [ + "django_mailman3" + ]; meta = with lib; { description = "Django library for Mailman UIs"; From b528b277579e2a9a2e99a58725e967960d80eca1 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Wed, 26 Jul 2023 01:12:37 +0200 Subject: [PATCH 05/19] python310Packages.django-compat: drop Not useful any longer and started failing to build with django 4. --- .../python-modules/django-compat/default.nix | 42 -------------- .../django-compat/fix-tests.diff | 56 ------------------- .../python-modules/django-hijack/default.nix | 2 - pkgs/top-level/python-aliases.nix | 1 + pkgs/top-level/python-packages.nix | 2 - 5 files changed, 1 insertion(+), 102 deletions(-) delete mode 100644 pkgs/development/python-modules/django-compat/default.nix delete mode 100644 pkgs/development/python-modules/django-compat/fix-tests.diff diff --git a/pkgs/development/python-modules/django-compat/default.nix b/pkgs/development/python-modules/django-compat/default.nix deleted file mode 100644 index d33a4be2817f..000000000000 --- a/pkgs/development/python-modules/django-compat/default.nix +++ /dev/null @@ -1,42 +0,0 @@ -{ lib, buildPythonPackage, fetchFromGitHub, python, - django, six -}: - -buildPythonPackage rec { - pname = "django-compat"; - version = "1.0.15"; - - # the pypi packages don't include everything required for the tests - src = fetchFromGitHub { - owner = "arteria"; - repo = "django-compat"; - rev = "v${version}"; - sha256 = "1pr6v38ahrsvxlgmcx69s4b5q5082f44gzi4h3c32sccdc4pwqxp"; - }; - - patches = [ - ./fix-tests.diff - ]; - - checkPhase = '' - runHook preCheck - - # to convince the tests to run against the installed package, not the source directory, we extract the - # tests directory from it then dispose of the actual source - mv compat/tests . - rm -r compat - substituteInPlace runtests.py --replace compat.tests tests - ${python.interpreter} runtests.py - - runHook postCheck - ''; - - propagatedBuildInputs = [ django six ]; - - meta = with lib; { - description = "Forward and backwards compatibility layer for Django 1.4, 1.7, 1.8, 1.9, 1.10 and 1.11"; - homepage = "https://github.com/arteria/django-compat"; - license = licenses.mit; - maintainers = with maintainers; [ ris ]; - }; -} diff --git a/pkgs/development/python-modules/django-compat/fix-tests.diff b/pkgs/development/python-modules/django-compat/fix-tests.diff deleted file mode 100644 index 58165db96a87..000000000000 --- a/pkgs/development/python-modules/django-compat/fix-tests.diff +++ /dev/null @@ -1,56 +0,0 @@ -diff -ur a/compat/tests/settings.py b/compat/tests/settings.py ---- a/compat/tests/settings.py 2020-03-06 15:32:07.548482597 +0100 -+++ b/compat/tests/settings.py 2020-03-06 22:19:25.422934249 +0100 -@@ -16,11 +16,12 @@ - 'django.contrib.admin', - 'django.contrib.auth', - 'django.contrib.contenttypes', -+ 'django.contrib.messages', - 'compat', - 'compat.tests.test_app', - ] - --MIDDLEWARE_CLASSES = ( -+MIDDLEWARE = ( - 'django.contrib.sessions.middleware.SessionMiddleware', - 'django.middleware.common.CommonMiddleware', - 'django.middleware.csrf.CsrfViewMiddleware', -@@ -43,6 +44,7 @@ - 'django.template.context_processors.i18n', - 'django.template.context_processors.tz', - 'django.template.context_processors.request', -+ 'django.contrib.messages.context_processors.messages', - ], - 'loaders': [ - 'django.template.loaders.filesystem.Loader', -diff -ur a/compat/tests/test_compat.py b/compat/tests/test_compat.py ---- a/compat/tests/test_compat.py 2020-03-06 15:32:07.548482597 +0100 -+++ b/compat/tests/test_compat.py 2020-03-06 15:37:39.202835075 +0100 -@@ -9,7 +9,7 @@ - from django.core.serializers.json import DjangoJSONEncoder - from django.test import TestCase, SimpleTestCase - from django.test.client import RequestFactory --from django.contrib.auth.views import logout -+from django.contrib.auth.views import auth_logout - try: - from django.urls import NoReverseMatch - except ImportError: -@@ -103,7 +103,7 @@ - Tests that passing a view name to ``resolve_url`` will result in the - URL path mapping to that view name. - """ -- resolved_url = resolve_url(logout) -+ resolved_url = resolve_url(auth_logout) - self.assertEqual('/accounts/logout/', resolved_url) - - ''' -diff -ur a/compat/tests/urls.py b/compat/tests/urls.py ---- a/compat/tests/urls.py 2020-03-06 15:32:07.548482597 +0100 -+++ b/compat/tests/urls.py 2020-03-06 15:34:25.962377799 +0100 -@@ -2,5 +2,5 @@ - from django.contrib.auth import views - - urlpatterns = [ -- url(r'^accounts/logout/$', views.logout, name='logout'), -+ url(r'^accounts/logout/$', views.auth_logout, name='logout'), - ] diff --git a/pkgs/development/python-modules/django-hijack/default.nix b/pkgs/development/python-modules/django-hijack/default.nix index 18ef2e3ace79..ef77abefeeae 100644 --- a/pkgs/development/python-modules/django-hijack/default.nix +++ b/pkgs/development/python-modules/django-hijack/default.nix @@ -11,7 +11,6 @@ # dependencies , django -, django-compat # tests , pytest-django @@ -54,7 +53,6 @@ buildPythonPackage rec { propagatedBuildInputs = [ django - django-compat ]; nativeCheckInputs = [ diff --git a/pkgs/top-level/python-aliases.nix b/pkgs/top-level/python-aliases.nix index a6ef2838bcb6..87ea55ac064e 100644 --- a/pkgs/top-level/python-aliases.nix +++ b/pkgs/top-level/python-aliases.nix @@ -93,6 +93,7 @@ mapAliases ({ django_classytags = django-classy-tags; # added 2023-07-25 django_colorful = django-colorful; # added 2023-07-25 django_compat = django-compat; # added 2023-07-25 + django-compat = throw "django-compat has been removed. It provided forward/backport compat for django 1.x, which is long end of life."; # added 2023-07-26 django_contrib_comments = django-contrib-comments; # added 2023-07-25 django-discover-runner = throw "django-discover-runner was removed because it is no longer maintained."; # added 2022-11-21 django_environ = django-environ; # added 2021-12-25 diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index cda5a120314a..b600ade3f23c 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2774,8 +2774,6 @@ self: super: with self; { django-colorful = callPackage ../development/python-modules/django-colorful { }; - django-compat = callPackage ../development/python-modules/django-compat { }; - django-compressor = callPackage ../development/python-modules/django-compressor { }; django-compression-middleware = callPackage ../development/python-modules/django-compression-middleware { }; From 7a56f3863fad43458141dbafff68679a056ad561 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Wed, 26 Jul 2023 01:50:51 +0200 Subject: [PATCH 06/19] python310Packages.django-haystack: disable tests on django_4 A few failing tests, but disabling individual ones is not straight forward. --- .../django-haystack/default.nix | 25 ++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/django-haystack/default.nix b/pkgs/development/python-modules/django-haystack/default.nix index e85d27f907bd..d9d6fb8ecd6f 100644 --- a/pkgs/development/python-modules/django-haystack/default.nix +++ b/pkgs/development/python-modules/django-haystack/default.nix @@ -4,12 +4,14 @@ , fetchPypi # build dependencies +, setuptools , setuptools-scm # dependencies , django # tests +, elasticsearch , geopy , nose , pysolr @@ -21,7 +23,8 @@ buildPythonPackage rec { pname = "django-haystack"; version = "3.2.1"; - format = "setuptools"; + format = "pyproject"; + disabled = pythonOlder "3.5"; src = fetchPypi { @@ -35,13 +38,22 @@ buildPythonPackage rec { ''; nativeBuildInputs = [ + setuptools setuptools-scm ]; - propagatedBuildInputs = [ + buildInputs = [ django ]; + passthru.optional-dependencies = { + elasticsearch = [ + elasticsearch + ]; + }; + + doCheck = lib.versionOlder django.version "4"; + nativeCheckInputs = [ geopy nose @@ -49,7 +61,14 @@ buildPythonPackage rec { python-dateutil requests whoosh - ]; + ] + ++ passthru.optional-dependencies.elasticsearch; + + checkPhase = '' + runHook preCheck + python test_haystack/run_tests.py + runHook postCheck + ''; meta = with lib; { description = "Pluggable search for Django"; From 002f6c08cb5280ee93ad2295d422bd8f79e21e8f Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Wed, 26 Jul 2023 01:55:30 +0200 Subject: [PATCH 07/19] python310Packages.mezzanine: propagate pytz Previously propagated by django_3, but not anymore by django_4. --- pkgs/development/python-modules/mezzanine/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/python-modules/mezzanine/default.nix b/pkgs/development/python-modules/mezzanine/default.nix index 9eda32b4e48a..46bf44bf8ad9 100644 --- a/pkgs/development/python-modules/mezzanine/default.nix +++ b/pkgs/development/python-modules/mezzanine/default.nix @@ -14,6 +14,7 @@ , pillow , pyflakes , pythonOlder +, pytz , requests , requests-oauthlib , tzlocal @@ -47,6 +48,7 @@ buildPythonPackage rec { future grappelli_safe pillow + pytz requests requests-oauthlib tzlocal From bff5a07ef86c1ac3ff7d83631d94fffa78578d83 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Wed, 26 Jul 2023 01:59:37 +0200 Subject: [PATCH 08/19] python310Packages.django-sites: mark broken with django_4 Uses API functions deprecated in Django 3.0 and removed in 4.0. --- pkgs/development/python-modules/django-sites/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/python-modules/django-sites/default.nix b/pkgs/development/python-modules/django-sites/default.nix index 5587014c5740..3a9255daecdf 100644 --- a/pkgs/development/python-modules/django-sites/default.nix +++ b/pkgs/development/python-modules/django-sites/default.nix @@ -37,5 +37,7 @@ buildPythonPackage rec { description = "Alternative implementation of django sites framework"; homepage = "https://github.com/niwinz/django-sites"; license = lib.licenses.bsd3; + # has not been updated for django>=4.0 + broken = lib.versionAtLeast django.version "4"; }; } From fe50817d1035e24c124ab6578d9080f388c4a784 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Wed, 26 Jul 2023 02:08:43 +0200 Subject: [PATCH 09/19] python310Packages.django-modelcluster: disable failing test One failing test with Django 4.2, that I reported upstream. Also migrate tests to pytest, so I can disable the failing test easily. --- .../django-modelcluster/default.nix | 35 ++++++++++++------- 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/pkgs/development/python-modules/django-modelcluster/default.nix b/pkgs/development/python-modules/django-modelcluster/default.nix index b7fbc9f2b179..5ad43dfc9b1f 100644 --- a/pkgs/development/python-modules/django-modelcluster/default.nix +++ b/pkgs/development/python-modules/django-modelcluster/default.nix @@ -1,11 +1,18 @@ { lib , buildPythonPackage , fetchFromGitHub -, django -, django-taggit -, pytz , pythonOlder -, python + +# dependencies +, django +, pytz + +# optionals +, django-taggit + +# tests +, pytest-django +, pytestCheckHook }: buildPythonPackage rec { @@ -17,8 +24,8 @@ buildPythonPackage rec { src = fetchFromGitHub { owner = "wagtail"; - repo = pname; - rev = "v${version}"; + repo = "modelcluster"; + rev = "refs/tags/v${version}"; hash = "sha256-p6hvOkPWRVJYLHvwyn9nS05wblikRFmlSYZuLiCcuqc="; }; @@ -31,13 +38,17 @@ buildPythonPackage rec { django-taggit ]; - nativeCheckInputs = passthru.optional-dependencies.taggit; + env.DJANGO_SETTINGS_MODULE = "tests.settings"; - checkPhase = '' - runHook preCheck - ${python.interpreter} ./runtests.py --noinput - runHook postCheck - ''; + nativeCheckInputs = [ + pytest-django + pytestCheckHook + ] ++ passthru.optional-dependencies.taggit; + + # https://github.com/wagtail/django-modelcluster/issues/173 + disabledTests = lib.optionals (lib.versionAtLeast django.version "4.2") [ + "test_formfield_callback" + ]; meta = with lib; { description = "Django extension to allow working with 'clusters' of models as a single unit, independently of the database"; From ca5c50bcf94e3f9af6f3e3456a5155ffb61bfea0 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Wed, 26 Jul 2023 02:24:49 +0200 Subject: [PATCH 10/19] python310Packages.drf-nested-routers: fix django4 compat by backporting patches, that have not yet made it into a new release. Move django into buildInputs, because we require consumers to bring their own django version anyway. Migrate tests to pytest, because they work very well and are easier to maintain. --- .../drf-nested-routers/default.nix | 42 ++++++++++++++----- 1 file changed, 32 insertions(+), 10 deletions(-) diff --git a/pkgs/development/python-modules/drf-nested-routers/default.nix b/pkgs/development/python-modules/drf-nested-routers/default.nix index 15676ed304b6..849fe8bb130c 100644 --- a/pkgs/development/python-modules/drf-nested-routers/default.nix +++ b/pkgs/development/python-modules/drf-nested-routers/default.nix @@ -1,33 +1,55 @@ { lib , buildPythonPackage , fetchFromGitHub -, setuptools +, fetchpatch , django , djangorestframework -, pytest -, pytest-cov +, pytestCheckHook , pytest-django , ipdb -, python }: buildPythonPackage rec { pname = "drf-nested-routers"; version = "0.93.4"; + format = "setuptools"; src = fetchFromGitHub { owner = "alanjds"; repo = "drf-nested-routers"; - rev = "v${version}"; + rev = "refs/tags/v${version}"; hash = "sha256-qlXNDydoQJ9FZB6G7yV/pNmx3BEo+lvRqsfjrvlbdNY="; }; - propagatedBuildInputs = [ django djangorestframework setuptools ]; - nativeCheckInputs = [ pytest pytest-cov pytest-django ipdb ]; + patches = [ + # django4 compatibility + (fetchpatch { + url = "https://github.com/alanjds/drf-nested-routers/commit/59764cc356f7f593422b26845a9dfac0ad196120.patch"; + hash = "sha256-mq3vLHzQlGl2EReJ5mVVQMMcYgGIVt/T+qi1STtQ0aI="; + }) + (fetchpatch { + url = "https://github.com/alanjds/drf-nested-routers/commit/723a5729dd2ffcb66fe315f229789ca454986fa4.patch"; + hash = "sha256-UCbBjwlidqsJ9vEEWlGzfqqMOr0xuB2TAaUxHsLzFfU="; + }) + (fetchpatch { + url = "https://github.com/alanjds/drf-nested-routers/commit/38e49eb73759bc7dcaaa9166169590f5315e1278.patch"; + hash = "sha256-IW4BLhHHhXDUZqHaXg46qWoQ89pMXv0ZxKjOCTnDcI0="; + }) + ]; - checkPhase = '' - ${python.interpreter} runtests.py --nolint - ''; + buildInputs = [ + django + ]; + + propagatedBuildInputs = [ + djangorestframework + ]; + + nativeCheckInputs = [ + ipdb + pytestCheckHook + pytest-django + ]; meta = with lib; { homepage = "https://github.com/alanjds/drf-nested-routers"; From 008c1402d2f372bc15603edaf5f1ef2a78ed0b14 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Wed, 26 Jul 2023 02:51:59 +0200 Subject: [PATCH 11/19] python310Packages.djangorestframework-guardian: mark broken with django4 and point people to the guardian2 fork. --- .../python-modules/djangorestframework-guardian/default.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/development/python-modules/djangorestframework-guardian/default.nix b/pkgs/development/python-modules/djangorestframework-guardian/default.nix index fdc6b3184d98..4358a61b3452 100644 --- a/pkgs/development/python-modules/djangorestframework-guardian/default.nix +++ b/pkgs/development/python-modules/djangorestframework-guardian/default.nix @@ -1,6 +1,7 @@ { lib , buildPythonPackage , fetchFromGitHub +, django , django-guardian , djangorestframework }: @@ -37,5 +38,7 @@ buildPythonPackage rec { homepage = "https://github.com/rpkilby/django-rest-framework-guardian"; license = licenses.bsd3; maintainers = with maintainers; [ ]; + # unmaintained, last compatible version is 3.x, use djangorestframework-guardian2 instead + broken = lib.versionAtLeast django.version "4"; }; } From a8932746670c00d542e51416bb080b248faecf68 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Wed, 26 Jul 2023 03:15:36 +0200 Subject: [PATCH 12/19] python310Packages.django-pattern-library: mark broken with django4 --- .../python-modules/django-pattern-library/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/python-modules/django-pattern-library/default.nix b/pkgs/development/python-modules/django-pattern-library/default.nix index 40cc4f64188a..00b6fe9c978f 100644 --- a/pkgs/development/python-modules/django-pattern-library/default.nix +++ b/pkgs/development/python-modules/django-pattern-library/default.nix @@ -51,5 +51,7 @@ buildPythonPackage rec { changelog = "https://github.com/torchbox/django-pattern-library/blob/v${version}/CHANGELOG.md"; license = licenses.bsd3; maintainers = with maintainers; [ sephi ]; + # https://github.com/torchbox/django-pattern-library/issues/212 + broken = lib.versionAtLeast django.version "4.2"; }; } From f1bc601c44eb23d1f263ef37918418d9918557e5 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Fri, 28 Jul 2023 17:49:13 +0200 Subject: [PATCH 13/19] python310Packages.wagtail: 4.2.2 -> 5.0.2 https://github.com/wagtail/wagtail/blob/v5.0.2/CHANGELOG.txt --- pkgs/development/python-modules/wagtail/default.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/wagtail/default.nix b/pkgs/development/python-modules/wagtail/default.nix index c01464f27ceb..54c30dabc781 100644 --- a/pkgs/development/python-modules/wagtail/default.nix +++ b/pkgs/development/python-modules/wagtail/default.nix @@ -24,19 +24,20 @@ buildPythonPackage rec { pname = "wagtail"; - version = "4.2.2"; + version = "5.0.2"; format = "setuptools"; disabled = pythonOlder "3.7"; src = fetchPypi { inherit pname version; - hash = "sha256-s89gs3H//Dc3k6BLZUC4APyDgiWY9LetWAkI+kXQTf8="; + hash = "sha256-3r0h34el2zRF1l/94S7xTjBqJPWtSQFQvtVW8Mjq0rs="; }; postPatch = '' substituteInPlace setup.py \ - --replace "beautifulsoup4>=4.8,<4.12" "beautifulsoup4>=4.8" + --replace "beautifulsoup4>=4.8,<4.12" "beautifulsoup4>=4.8" \ + --replace "Pillow>=4.0.0,<10.0.0" "Pillow>=9.1.0,<11.0.0" ''; propagatedBuildInputs = [ From 87f04f12a469f9da4f34f161314a076a1a2df144 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Fri, 28 Jul 2023 17:44:46 +0200 Subject: [PATCH 14/19] python310Packages.willow: 1.4.1 -> 1.5.1 --- .../python-modules/willow/default.nix | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/pkgs/development/python-modules/willow/default.nix b/pkgs/development/python-modules/willow/default.nix index d4d297d68d4d..f7030f7c874e 100644 --- a/pkgs/development/python-modules/willow/default.nix +++ b/pkgs/development/python-modules/willow/default.nix @@ -2,22 +2,29 @@ , buildPythonPackage , fetchPypi , pythonOlder -, six -, pillow + +# dependencies +, filetype +, defusedxml, }: buildPythonPackage rec { pname = "willow"; - version = "1.4.1"; + version = "1.5.1"; + format = "setuptools"; + disabled = pythonOlder "2.7"; src = fetchPypi { pname = "Willow"; inherit version; - hash = "sha256-Dfj/UoUx4AtI1Av3Ltgb6sHcgvLULlu+1K/wIYvvjA0="; + hash = "sha256-t6SQkRATP9seIodZLgZzzCVeAobhzVNCfuaN8ckiDEw="; }; - propagatedBuildInputs = [ six pillow ]; + propagatedBuildInputs = [ + filetype + defusedxml + ]; # Test data is not included # https://github.com/torchbox/Willow/issues/34 From 7cb5d0503cdcf616f2c0ab09827cf31f82f52837 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Wed, 2 Aug 2023 03:55:21 +0200 Subject: [PATCH 15/19] python310Packages.qcodes: disable timing-sensitive test --- pkgs/development/python-modules/qcodes/default.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/development/python-modules/qcodes/default.nix b/pkgs/development/python-modules/qcodes/default.nix index db565e11d02d..3dd8342ec1cd 100644 --- a/pkgs/development/python-modules/qcodes/default.nix +++ b/pkgs/development/python-modules/qcodes/default.nix @@ -124,6 +124,11 @@ buildPythonPackage rec { "--durations=20" ]; + disabledTests = [ + # timing sensitive + "test_access_channels_by_slice" + ]; + disabledTestPaths = [ # depends on qcodes-loop, causing a cyclic dependency "qcodes/tests/dataset/measurement/test_load_legacy_data.py" From 84f6a6755a0832ca0e9b22c158a13869f3805132 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Wed, 2 Aug 2023 04:35:34 +0200 Subject: [PATCH 16/19] mailmanPackages: pin to django_3 --- pkgs/servers/mail/mailman/python.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/servers/mail/mailman/python.nix b/pkgs/servers/mail/mailman/python.nix index 288e48d814e4..dfd8790302fd 100644 --- a/pkgs/servers/mail/mailman/python.nix +++ b/pkgs/servers/mail/mailman/python.nix @@ -2,6 +2,8 @@ python3.override { packageOverrides = self: super: { + django = super.django_3; + # does not find tests alembic = super.alembic.overridePythonAttrs (oldAttrs: { doCheck = false; From f4d64ea14978c37a74d5086a8b0bf25fcae65e52 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Wed, 2 Aug 2023 04:57:48 +0200 Subject: [PATCH 17/19] baserow: pin django_3 --- pkgs/servers/baserow/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/servers/baserow/default.nix b/pkgs/servers/baserow/default.nix index 92007bd6ee44..a91e6ba774dc 100644 --- a/pkgs/servers/baserow/default.nix +++ b/pkgs/servers/baserow/default.nix @@ -29,6 +29,8 @@ let doCheck = false; }; + + django = super.django_3; }; }; in From dc9e777948aacad8ad054b7306984de7db98819a Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Wed, 2 Aug 2023 05:25:22 +0200 Subject: [PATCH 18/19] python310Packages.nplusone: mark broken with django_4 --- pkgs/development/python-modules/nplusone/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/python-modules/nplusone/default.nix b/pkgs/development/python-modules/nplusone/default.nix index ecf2255b3593..5a31394c2d35 100644 --- a/pkgs/development/python-modules/nplusone/default.nix +++ b/pkgs/development/python-modules/nplusone/default.nix @@ -1,6 +1,7 @@ { lib , blinker , buildPythonPackage +, django , fetchFromGitHub , flake8 , flask-sqlalchemy @@ -79,5 +80,6 @@ buildPythonPackage rec { homepage = "https://github.com/jmcarp/nplusone"; maintainers = with maintainers; [ cript0nauta ]; license = licenses.mit; + broken = lib.versionAtLeast django.version "4"; }; } From 99dca946e6f8daa0e9626e42f402023db0cf0def Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Thu, 3 Aug 2023 03:26:10 +0200 Subject: [PATCH 19/19] privacyidea: pin to django_3 --- pkgs/applications/misc/privacyidea/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/applications/misc/privacyidea/default.nix b/pkgs/applications/misc/privacyidea/default.nix index 74efc4c1db02..2a7f6c50c733 100644 --- a/pkgs/applications/misc/privacyidea/default.nix +++ b/pkgs/applications/misc/privacyidea/default.nix @@ -9,6 +9,8 @@ let python3' = python310.override { packageOverrides = self: super: { + django = super.django_3; + sqlalchemy = super.sqlalchemy.overridePythonAttrs (oldAttrs: rec { version = "1.3.24"; src = fetchPypi {