diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9dece68ef..5c8292ebd 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: @@ -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 @@ -77,14 +78,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: @@ -108,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 @@ -152,7 +156,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 @@ -161,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 diff --git a/docs/changes.rst b/docs/changes.rst index 638d2d658..d4401dac8 100644 --- a/docs/changes.rst +++ b/docs/changes.rst @@ -4,6 +4,7 @@ Change log Pending ------- +* Added Python 3.12 to test matrix. * Removed outdated third-party panels from the list. * Avoided the unnecessary work of recursively quoting SQL parameters. * Postponed context process in templates panel to include lazy evaluated 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) diff --git a/tox.ini b/tox.ini index 1bbdef0e1..5e3778329 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,50,main}-{sqlite,postgresql,psycopg3,postgis,mysql} + py{310,311,312}-dj{42,50,main}-{sqlite,postgresql,psycopg3,postgis,mysql} [testenv] deps = @@ -50,25 +50,29 @@ 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,50,main}-{postgresql,psycopg3}] + +[testenv:py{38,39,310,311,312}-dj{32,40,41,42,50,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,50,main}-postgis] + +[testenv:py{38,39,310,311,312}-dj{32,40,41,42,50,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,50,main}-mysql] + +[testenv:py{38,39,310,311,312}-dj{32,40,41,42,50,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,50,main}-sqlite] + +[testenv:py{38,39,310,311,312}-dj{32,40,41,42,50,main}-sqlite] setenv = {[testenv]setenv} DB_BACKEND = sqlite3 @@ -96,6 +100,7 @@ python = 3.9: py39 3.10: py310 3.11: py311 + 3.12: py312 [gh-actions:env] DB_BACKEND =