From d92dcb804883d4d6e968f32b6bb70837c054338f Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Tue, 16 Jan 2024 18:50:50 +0000 Subject: [PATCH] requirements: Bump Django to 5.x.x, django-filter to 23.5.0 One issue to address, which is caused by changes in Django commit 500e01073ad [1]. We also drop support for Django 3.2, which goes EOL in April 2024, and Django 4.1, which already went EOL in December 2023. [1] https://github.com/django/django/commit/500e01073ad Signed-off-by: Stephen Finucane --- patchwork/forms.py | 6 +++++- .../notes/django-5-0-support-923e45ec2dc93117.yaml | 10 ++++++++++ requirements-dev.txt | 9 ++++----- requirements-prod.txt | 4 ++-- requirements-test.txt | 4 ++-- tox.ini | 13 +++++-------- 6 files changed, 28 insertions(+), 18 deletions(-) create mode 100644 releasenotes/notes/django-5-0-support-923e45ec2dc93117.yaml diff --git a/patchwork/forms.py b/patchwork/forms.py index e7d1ad27..688fb1a0 100644 --- a/patchwork/forms.py +++ b/patchwork/forms.py @@ -3,6 +3,7 @@ # # SPDX-License-Identifier: GPL-2.0-or-later +import django from django.contrib.auth.models import User from django import forms from django.forms import renderers @@ -158,7 +159,10 @@ class OptionalModelChoiceField(forms.ModelChoiceField): choices.append(self.no_change_choice) return choices - choices = property(_get_choices, forms.ChoiceField._set_choices) + if django.VERSION >= (5, 0): + choices = property(_get_choices, forms.ChoiceField.choices.fset) + else: + choices = property(_get_choices, forms.ChoiceField._set_choices) def is_no_change(self, value): return value == self.no_change_choice[0] diff --git a/releasenotes/notes/django-5-0-support-923e45ec2dc93117.yaml b/releasenotes/notes/django-5-0-support-923e45ec2dc93117.yaml new file mode 100644 index 00000000..84ec0596 --- /dev/null +++ b/releasenotes/notes/django-5-0-support-923e45ec2dc93117.yaml @@ -0,0 +1,10 @@ +--- +features: + - | + `Django 5.0 `_ is + now supported. +upgrade: + - | + Django 3.2 and 4.1 are no longer supported. 4.1 is no longer supported + upstream while Django 3.2 goes EOL in April 2024. Most distributions + provide a newer version. diff --git a/requirements-dev.txt b/requirements-dev.txt index b80cd113..47ee9afe 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,7 +1,6 @@ -Django~=4.2.0 +Django~=5.0.0 djangorestframework~=3.14.0 -django-filter~=23.2.0 -django-debug-toolbar~=4.1.0 -# This does not support Django 4.0 -# django-dbbackup~=3.3.0 +django-filter~=23.5.0 +django-debug-toolbar~=4.2.0 +django-dbbackup~=4.1.0 -r requirements-test.txt diff --git a/requirements-prod.txt b/requirements-prod.txt index d450473b..75c3825e 100644 --- a/requirements-prod.txt +++ b/requirements-prod.txt @@ -1,5 +1,5 @@ -Django~=4.2.0 +Django~=5.0.0 djangorestframework~=3.14.0 -django-filter~=23.2.0 +django-filter~=23.5.0 psycopg2~=2.9.0 sqlparse~=0.4.0 diff --git a/requirements-test.txt b/requirements-test.txt index f538b61d..5e9000ed 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -2,6 +2,6 @@ mysqlclient~=2.2.0 psycopg2-binary~=2.9.0 sqlparse~=0.4.0 python-dateutil~=2.8.0 -tblib~=2.0.0 +tblib~=3.0.0 openapi-core~=0.18.0 -termcolor~=2.3.0 +termcolor~=2.4.0 diff --git a/tox.ini b/tox.ini index 5d33bcd5..4276ed1b 100644 --- a/tox.ini +++ b/tox.ini @@ -1,20 +1,17 @@ [tox] minversion = 3.2 -envlist = pep8,docs,py{38,39}-django32,py{38,39,310,311}-django{41,42} +envlist = pep8,docs,py{38,39,310,311}-django42,py{310,311,312}-django50 [testenv] skip_install = true deps = -r{toxinidir}/requirements-test.txt - django32: django~=3.2.0 - django32: djangorestframework~=3.14.0 - django32: django-filter~=23.2.0 - django41: django~=4.1.0 - django41: djangorestframework~=3.14.0 - django41: django-filter~=23.2.0 django42: django~=4.2.0 django42: djangorestframework~=3.14.0 - django42: django-filter~=23.2.0 + django42: django-filter~=23.5.0 + django50: django~=5.0.0 + django50: djangorestframework~=3.14.0 + django50: django-filter~=23.5.0 setenv = DJANGO_SETTINGS_MODULE = patchwork.settings.dev PYTHONDONTWRITEBYTECODE = 1 -- 2.47.3