From c5195157c9c27fabe151a7b8dbcba9d7005de1d7 Mon Sep 17 00:00:00 2001 From: Tim Schilling Date: Sat, 22 Jul 2023 10:48:45 -0500 Subject: [PATCH 1/4] Add Python 3.12 to the test matrix. --- .github/workflows/test.yml | 10 ++++++---- docs/changes.rst | 2 ++ tox.ini | 11 ++++++----- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9dece68ef..0cd9c5f01 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,7 +14,7 @@ jobs: fail-fast: false max-parallel: 5 matrix: - python-version: ['3.8', '3.9', '3.10', '3.11'] + python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] services: mariadb: @@ -77,14 +77,16 @@ jobs: fail-fast: false max-parallel: 5 matrix: - python-version: ['3.8', '3.9', '3.10', '3.11'] + python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] database: [postgresql, postgis] - # Add psycopg3 to our matrix for 3.10 and 3.11 + # Add psycopg3 to our matrix for modern python versions include: - python-version: '3.10' database: psycopg3 - python-version: '3.11' database: psycopg3 + - python-version: '3.12' + database: psycopg3 services: postgres: @@ -152,7 +154,7 @@ jobs: fail-fast: false max-parallel: 5 matrix: - python-version: ['3.8', '3.9', '3.10', '3.11'] + python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] steps: - uses: actions/checkout@v3 diff --git a/docs/changes.rst b/docs/changes.rst index 89f5bdc7e..62ed75364 100644 --- a/docs/changes.rst +++ b/docs/changes.rst @@ -4,6 +4,8 @@ Change log Pending ------- +* Add Python 3.12 to test matrix. + 4.2.0 (2023-08-10) ------------------ diff --git a/tox.ini b/tox.ini index 5154d4907..7df469d9f 100644 --- a/tox.ini +++ b/tox.ini @@ -6,7 +6,7 @@ envlist = py{38,39,310}-dj32-{sqlite,postgresql,postgis,mysql} py310-dj40-sqlite py{310,311}-dj41-{sqlite,postgresql,postgis,mysql} - py{310,311}-dj{42,main}-{sqlite,postgresql,psycopg3,postgis,mysql} + py{310,311,312}-dj{42,main}-{sqlite,postgresql,psycopg3,postgis,mysql} [testenv] deps = @@ -49,25 +49,25 @@ allowlist_externals = make pip_pre = True commands = python -b -W always -m coverage run -m django test -v2 {posargs:tests} -[testenv:py{38,39,310,311}-dj{32,40,41,42,main}-{postgresql,psycopg3}] +[testenv:py{38,39,310,311,312}-dj{32,40,41,42,main}-{postgresql,psycopg3}] setenv = {[testenv]setenv} DB_BACKEND = postgresql DB_PORT = {env:DB_PORT:5432} -[testenv:py{38,39,310,311}-dj{32,40,41,42,main}-postgis] +[testenv:py{38,39,310,311,312}-dj{32,40,41,42,main}-postgis] setenv = {[testenv]setenv} DB_BACKEND = postgis DB_PORT = {env:DB_PORT:5432} -[testenv:py{38,39,310,311}-dj{32,40,41,42,main}-mysql] +[testenv:py{38,39,310,311,312}-dj{32,40,41,42,main}-mysql] setenv = {[testenv]setenv} DB_BACKEND = mysql DB_PORT = {env:DB_PORT:3306} -[testenv:py{38,39,310,311}-dj{32,40,41,42,main}-sqlite] +[testenv:py{38,39,310,311,312}-dj{32,40,41,42,main}-sqlite] setenv = {[testenv]setenv} DB_BACKEND = sqlite3 @@ -95,6 +95,7 @@ python = 3.9: py39 3.10: py310 3.11: py311 + 3.12: py312 [gh-actions:env] DB_BACKEND = From 96ebbb3720eef06ee4f33550e17670e7e0862ab6 Mon Sep 17 00:00:00 2001 From: Tim Schilling Date: Sat, 22 Jul 2023 10:55:20 -0500 Subject: [PATCH 2/4] Allow pre-releases for setup actions with GitHub actions. --- .github/workflows/test.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0cd9c5f01..5c8292ebd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -36,6 +36,7 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} + allow-prereleases: true - name: Get pip cache dir id: pip-cache @@ -110,6 +111,7 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} + allow-prereleases: true - name: Get pip cache dir id: pip-cache @@ -163,6 +165,7 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} + allow-prereleases: true - name: Get pip cache dir id: pip-cache From 44ab23f4aa1a1561e803cd32dd06aed0fa58fab4 Mon Sep 17 00:00:00 2001 From: tschilling Date: Sat, 12 Aug 2023 06:30:16 -0500 Subject: [PATCH 3/4] Skip unnecessary test for python 3.12 --- tests/panels/test_profiling.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/panels/test_profiling.py b/tests/panels/test_profiling.py index ff613dfe1..88ec57dd6 100644 --- a/tests/panels/test_profiling.py +++ b/tests/panels/test_profiling.py @@ -1,3 +1,6 @@ +import sys +import unittest + from django.contrib.auth.models import User from django.db import IntegrityError, transaction from django.http import HttpResponse @@ -50,6 +53,10 @@ def test_cum_time_threshold(self): self.assertNotIn("render", content) self.assertValidHTML(content) + @unittest.skipUnless( + sys.version_info < (3, 12, 0), + "Python 3.12 no longer contains a frame for list comprehensions.", + ) def test_listcomp_escaped(self): self._get_response = lambda request: listcomp_view(request) response = self.panel.process_request(self.request) From 63f4d7f4aed339627d7652e9bf96faf10f322bf5 Mon Sep 17 00:00:00 2001 From: Tim Schilling Date: Mon, 14 Aug 2023 08:12:14 -0500 Subject: [PATCH 4/4] Update docs/changes.rst Co-authored-by: Matthias Kestenholz --- docs/changes.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/changes.rst b/docs/changes.rst index 62ed75364..67449864a 100644 --- a/docs/changes.rst +++ b/docs/changes.rst @@ -4,7 +4,7 @@ Change log Pending ------- -* Add Python 3.12 to test matrix. +* Added Python 3.12 to test matrix. 4.2.0 (2023-08-10) ------------------