From patchwork Thu Sep 30 10:55:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Finucane X-Patchwork-Id: 1534770 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="key not found in DNS" header.d=that.guru header.i=@that.guru header.a=rsa-sha256 header.s=x header.b=tYAzRYNo; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=2404:9400:2:0:216:3eff:fee1:b9f1; helo=lists.ozlabs.org; envelope-from=patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2404:9400:2:0:216:3eff:fee1:b9f1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HKqsq0sCjz9sRf for ; Thu, 30 Sep 2021 20:55:58 +1000 (AEST) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4HKqsp4g83z30Qv for ; Thu, 30 Sep 2021 20:55:58 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="key not found in DNS" header.d=that.guru header.i=@that.guru header.a=rsa-sha256 header.s=x header.b=tYAzRYNo; dkim-atps=neutral X-Original-To: patchwork@lists.ozlabs.org Delivered-To: patchwork@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=that.guru (client-ip=136.175.108.182; helo=mail-108-mta182.mxroute.com; envelope-from=stephen@that.guru; receiver=) Authentication-Results: lists.ozlabs.org; dkim=fail reason="key not found in DNS" header.d=that.guru header.i=@that.guru header.a=rsa-sha256 header.s=x header.b=tYAzRYNo; dkim-atps=neutral Received: from mail-108-mta182.mxroute.com (mail-108-mta182.mxroute.com [136.175.108.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4HKqsJ2BTmz2yR8 for ; Thu, 30 Sep 2021 20:55:30 +1000 (AEST) Received: from filter004.mxroute.com ([149.28.56.236] filter004.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta182.mxroute.com (ZoneMTA) with ESMTPSA id 17c36583ed60008545.001 for (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256); Thu, 30 Sep 2021 10:55:25 +0000 X-Zone-Loop: 32fe4f122286de0546efa2922e89a8103bf14e3ddae4 X-Originating-IP: [149.28.56.236] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=that.guru; s=x; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=g7t3CY1r5v3XVZWW5Jo7/Y6ClNsZtQwTVkFURvK7Rso=; b=tYAzRYNoTqqgkTaf0+8IpzZ0og 0brGzC4cWdkHHpka/GYzOP8zLCrHsAsAbJISlP4iaJ3wyJQgnajD109guTVQNEDwtxfG97delfkF2 eEQ6tM3YKb8GVozgIqO+u3KpL+bzNkxvaMqMMDvVKE/3OfslfyIGCpYVEZiJDVHF+s2+9bVDCeMFN aDnoZYbqG4zAiE+lrUyGBZKaqYGitjsc9R7r8jIK6UoVIZtp7uHk6uLATHZM5yqIKUVIZIQd/2JVy kmB1wddwZFgNbjaoayqXUpssUQeKoxUvUgTOPn6n1honn0k5Da2KlR0II0efvb3AgLqbLSiYXdIvf zq6zJeXA==; From: Stephen Finucane To: patchwork@lists.ozlabs.org Subject: [PATCH 3/6] requirements: Bump Django to 3.2.x, django-filter to 21.1 Date: Thu, 30 Sep 2021 11:55:15 +0100 Message-Id: <20210930105518.487744-3-stephen@that.guru> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210930105518.487744-1-stephen@that.guru> References: <20210930105518.487744-1-stephen@that.guru> MIME-Version: 1.0 X-AuthUser: stephen@that.guru X-BeenThere: patchwork@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Patchwork development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Patchwork" It seems the ORM is now smarter and requires less JOINs that previously in two tests. In addition, a new setting is required to ensure the type of our primary field columns doesn't change when Django 4.0 is released. We drop support for Django 3.1 in the process, though this doesn't have much of a real-world impact since we still support Django 2.2, an LTS release. Signed-off-by: Stephen Finucane --- patchwork/settings/base.py | 4 ++++ patchwork/tests/api/test_event.py | 6 +++++- patchwork/tests/api/test_patch.py | 6 +++++- .../notes/django-3-2-support-363b32e74bdcf017.yaml | 9 +++++++++ requirements-dev.txt | 4 ++-- requirements-prod.txt | 4 ++-- tox.ini | 12 ++++++------ 7 files changed, 33 insertions(+), 12 deletions(-) create mode 100644 releasenotes/notes/django-3-2-support-363b32e74bdcf017.yaml diff --git patchwork/settings/base.py patchwork/settings/base.py index c1bb9b27..ff14d91b 100644 --- patchwork/settings/base.py +++ patchwork/settings/base.py @@ -68,6 +68,10 @@ TEMPLATES = [ }, ] +# TODO(stephenfin): Consider changing to BigAutoField when we drop support for +# Django < 3.2 +DEFAULT_AUTO_FIELD = 'django.db.models.AutoField' + DEFAULT_FROM_EMAIL = 'Patchwork ' SERVER_EMAIL = DEFAULT_FROM_EMAIL diff --git patchwork/tests/api/test_event.py patchwork/tests/api/test_event.py index 32e99366..62506a5b 100644 --- patchwork/tests/api/test_event.py +++ patchwork/tests/api/test_event.py @@ -5,6 +5,7 @@ import unittest +import django from django.conf import settings from django.urls import reverse @@ -187,7 +188,10 @@ class TestEventAPI(utils.APITestCase): for _ in range(3): self._create_events() - with self.assertNumQueries(28): + # TODO(stephenfin): Remove when we drop support for Django < 3.2 + num_queries = 28 if django.VERSION < (3, 2) else 27 + + with self.assertNumQueries(num_queries): self.client.get(self.api_url()) def test_order_by_date_default(self): diff --git patchwork/tests/api/test_patch.py patchwork/tests/api/test_patch.py index 1c616409..36c3e5f9 100644 --- patchwork/tests/api/test_patch.py +++ patchwork/tests/api/test_patch.py @@ -7,6 +7,7 @@ import email.parser from email.utils import make_msgid import unittest +import django from django.conf import settings from django.urls import NoReverseMatch from django.urls import reverse @@ -228,7 +229,10 @@ class TestPatchAPI(utils.APITestCase): series = create_series() create_patches(5, series=series) - with self.assertNumQueries(7): + # TODO(stephenfin): Remove when we drop support for Django < 3.2 + num_queries = 7 if django.VERSION < (3, 2) else 5 + + with self.assertNumQueries(num_queries): self.client.get(self.api_url()) @utils.store_samples('patch-detail') diff --git releasenotes/notes/django-3-2-support-363b32e74bdcf017.yaml releasenotes/notes/django-3-2-support-363b32e74bdcf017.yaml new file mode 100644 index 00000000..039535e9 --- /dev/null +++ releasenotes/notes/django-3-2-support-363b32e74bdcf017.yaml @@ -0,0 +1,9 @@ +--- +features: + - | + `Django 3.2 `_ is now + supported. +upgrade: + - | + Django 3.1 is no longer supported. It is no longer supported upstream and + most distributions provide a newer version. diff --git requirements-dev.txt requirements-dev.txt index d58dfaa9..437b1e8b 100644 --- requirements-dev.txt +++ requirements-dev.txt @@ -1,6 +1,6 @@ -Django~=3.1.0 +Django~=3.2.0 djangorestframework~=3.12.0 -django-filter~=2.4.0 +django-filter~=21.1.0 django-debug-toolbar~=3.2.0 django-dbbackup~=3.3.0 -r requirements-test.txt diff --git requirements-prod.txt requirements-prod.txt index 6bac4d6a..fa6bc95f 100644 --- requirements-prod.txt +++ requirements-prod.txt @@ -1,5 +1,5 @@ -Django~=3.1.0 +Django~=3.2.0 djangorestframework~=3.12.0 -django-filter~=2.4.0 +django-filter~=21.1.0 psycopg2-binary~=2.8.0 sqlparse~=0.4.0 diff --git tox.ini tox.ini index 46d72517..8eab01da 100644 --- tox.ini +++ tox.ini @@ -1,6 +1,6 @@ [tox] minversion = 3.2 -envlist = pep8,docs,py{36,37,38,39}-django{22,30,31} +envlist = pep8,docs,py{36,37,38,39}-django{22,31,32} skipsdist = true ignore_basepython_conflict = true @@ -10,13 +10,13 @@ deps = -r{toxinidir}/requirements-test.txt django22: django>=2.2,<2.3 django22: djangorestframework>=3.10,<3.13 - django22: django-filter>=2.1,<3.0 - django30: django>=3.0,<3.1 - django30: djangorestframework>=3.10,<3.13 - django30: django-filter>=2.2,<3.0 + django22: django-filter~=21.1.0 django31: django>=3.1,<3.2 django31: djangorestframework>=3.10,<3.13 - django31: django-filter>=2.3,<3.0 + django31: django-filter~=21.1.0 + django32: django>=3.2,<3.3 + django32: djangorestframework>=3.10,<3.13 + django32: django-filter~=21.1.0 setenv = DJANGO_SETTINGS_MODULE = patchwork.settings.dev PYTHONDONTWRITEBYTECODE = 1