diff options
author | Martin Weinelt <mweinelt@users.noreply.github.com> | 2023-08-04 01:55:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-04 01:55:19 +0200 |
commit | 09f5e7d840154e63b710ece7c66a4d4a130b14d3 (patch) | |
tree | c0de63b1d8e30cea48276d80e257d2d2f6f643f8 /pkgs | |
parent | c0731df13c4e4895904249923033d5b886aad021 (diff) | |
parent | 99dca946e6f8daa0e9626e42f402023db0cf0def (diff) | |
download | nixlib-09f5e7d840154e63b710ece7c66a4d4a130b14d3.tar nixlib-09f5e7d840154e63b710ece7c66a4d4a130b14d3.tar.gz nixlib-09f5e7d840154e63b710ece7c66a4d4a130b14d3.tar.bz2 nixlib-09f5e7d840154e63b710ece7c66a4d4a130b14d3.tar.lz nixlib-09f5e7d840154e63b710ece7c66a4d4a130b14d3.tar.xz nixlib-09f5e7d840154e63b710ece7c66a4d4a130b14d3.tar.zst nixlib-09f5e7d840154e63b710ece7c66a4d4a130b14d3.zip |
Merge pull request #245436 from mweinelt/django-default
python310Packages.django: migrate to django_4
Diffstat (limited to 'pkgs')
20 files changed, 158 insertions, 152 deletions
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 { 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" ]; 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-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"; 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/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="; }; + postPatch = '' + substituteInPlace setup.py \ + --replace 'django>=3.2,<4.2' 'django>=3.2,<4.3' + ''; + propagatedBuildInputs = [ - django-gravatar2 django-compressor django-allauth mailmanclient + django-allauth + django-gravatar2 + mailmanclient + pytz ]; - nativeCheckInputs = [ django mock ]; - checkPhase = '' - cd $NIX_BUILD_TOP/$sourceRoot - PYTHONPATH=.:$PYTHONPATH django-admin.py test --settings=django_mailman3.tests.settings_test - ''; + nativeCheckInputs = [ + django + pytest-django + pytestCheckHook + ]; - pythonImportsCheck = [ "django_mailman3" ]; + pythonImportsCheck = [ + "django_mailman3" + ]; meta = with lib; { description = "Django library for Mailman UIs"; 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 +, pythonOlder + +# dependencies , django -, django-taggit , pytz -, pythonOlder -, python + +# 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"; 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"; }; } 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; 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"; }; } 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"; }; } 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"; 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 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"; }; } 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" diff --git a/pkgs/servers/baserow/default.nix b/pkgs/servers/baserow/default.nix index 7b34075233dc..24b2e7b3aaa2 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 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; diff --git a/pkgs/top-level/python-aliases.nix b/pkgs/top-level/python-aliases.nix index 116aea4c8220..21f3ee1f4a4b 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 6e4c091721af..008e5ecd4247 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2729,12 +2729,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 { }; @@ -2777,8 +2776,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 { }; |