From 1094ca551be1d7d3ab91b666b2944cccddd6875a Mon Sep 17 00:00:00 2001 From: Minijackson Date: Wed, 31 Jul 2024 10:27:08 +0200 Subject: [PATCH] python3Packages.djangorestframework: disable pytz when django >= 5 The use of pytz is deprecated for Django >= 4 and removed for Django >= 5. Building djangorestframework with django_5 and pytz caused test failures. And add pytz back in django-timezone-field as native check input --- .../development/python-modules/django-filter/default.nix | 2 ++ .../python-modules/django-timezone-field/default.nix | 2 ++ .../python-modules/djangorestframework/default.nix | 9 ++------- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/pkgs/development/python-modules/django-filter/default.nix b/pkgs/development/python-modules/django-filter/default.nix index 27ba6d8cf68f..f1d0f1a5aaeb 100644 --- a/pkgs/development/python-modules/django-filter/default.nix +++ b/pkgs/development/python-modules/django-filter/default.nix @@ -7,6 +7,7 @@ djangorestframework, pytestCheckHook, pytest-django, + pytz, }: buildPythonPackage rec { @@ -29,6 +30,7 @@ buildPythonPackage rec { djangorestframework pytestCheckHook pytest-django + pytz ]; env.DJANGO_SETTINGS_MODULE = "tests.settings"; diff --git a/pkgs/development/python-modules/django-timezone-field/default.nix b/pkgs/development/python-modules/django-timezone-field/default.nix index e53b0da04c4a..978ae2e8e39e 100644 --- a/pkgs/development/python-modules/django-timezone-field/default.nix +++ b/pkgs/development/python-modules/django-timezone-field/default.nix @@ -9,6 +9,7 @@ pytestCheckHook, pytest-django, pytest-lazy-fixture, + pytz, }: buildPythonPackage rec { @@ -43,6 +44,7 @@ buildPythonPackage rec { pytestCheckHook pytest-django pytest-lazy-fixture + pytz ]; meta = with lib; { diff --git a/pkgs/development/python-modules/djangorestframework/default.nix b/pkgs/development/python-modules/djangorestframework/default.nix index 184307a5a2e4..2bd0f7acbd61 100644 --- a/pkgs/development/python-modules/djangorestframework/default.nix +++ b/pkgs/development/python-modules/djangorestframework/default.nix @@ -35,14 +35,9 @@ buildPythonPackage rec { hash = "sha256-G914NvxRmKGkxrozoWNUIoI74YkYRbeNcQwIG4iSeXU="; }; - build-system = [ - setuptools - ]; + build-system = [ setuptools ]; - dependencies = [ - django - pytz - ]; + dependencies = [ django ] ++ (lib.optional (lib.versionOlder django.version "5.0.0") pytz); nativeCheckInputs = [ pytest-django