From a8b7b61dcf93b9e87177c159e0f179f1365705bb Mon Sep 17 00:00:00 2001 From: Abeed Visram Date: Wed, 9 Oct 2024 20:00:28 +0100 Subject: [PATCH 1/5] Added in support for Python 3.13 Shout-out to London Django Meetup for the Hacktoberfest Hackathon inspiration. --- .github/workflows/test.yml | 9 ++++++--- docs/changes.rst | 2 ++ pyproject.toml | 1 + tox.ini | 13 +++++++------ 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cd5d8dd8b..4f313a92b 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', '3.12'] + python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] services: mariadb: @@ -73,7 +73,7 @@ jobs: fail-fast: false max-parallel: 5 matrix: - python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] + python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] database: [postgresql, postgis] # Add psycopg3 to our matrix for modern python versions include: @@ -83,6 +83,9 @@ jobs: database: psycopg3 - python-version: '3.12' database: psycopg3 + - python-version: '3.13' + # psycopg installs version 3+; psycopg3 not found via pip in python 3.13 + database: psycopg services: postgres: @@ -145,7 +148,7 @@ jobs: fail-fast: false max-parallel: 5 matrix: - python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] + python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] steps: - uses: actions/checkout@v4 diff --git a/docs/changes.rst b/docs/changes.rst index abf709b45..584ff7407 100644 --- a/docs/changes.rst +++ b/docs/changes.rst @@ -4,6 +4,8 @@ Change log Pending ------- +* Added support for Python 3.13 and to the CI matrix. + 5.0.0-alpha (2024-09-01) ------------------------ diff --git a/pyproject.toml b/pyproject.toml index 611015e13..a4c687dcf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,6 +30,7 @@ classifiers = [ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Topic :: Software Development :: Libraries :: Python Modules", ] dynamic = [ diff --git a/tox.ini b/tox.ini index 1bba8d38f..c27ee4b04 100644 --- a/tox.ini +++ b/tox.ini @@ -3,8 +3,8 @@ isolated_build = true envlist = docs packaging - py{38,39,310,311,312}-dj{42}-{sqlite,postgresql,postgis,mysql} - py{310,311,312}-dj{42,50,51,main}-{sqlite,postgresql,psycopg3,postgis,mysql} + py{38,39,310,311,312,313}-dj{42}-{sqlite,postgresql,postgis,mysql} + py{310,311,312,313}-dj{42,50,51,main}-{sqlite,postgresql,psycopg3,postgis,mysql} [testenv] deps = @@ -49,28 +49,28 @@ pip_pre = True commands = python -b -W always -m coverage run -m django test -v2 {posargs:tests} -[testenv:py{38,39,310,311,312}-dj{42,50,51,main}-{postgresql,psycopg3}] +[testenv:py{38,39,310,311,312,313}-dj{42,50,51,main}-{postgresql,psycopg3}] setenv = {[testenv]setenv} DB_BACKEND = postgresql DB_PORT = {env:DB_PORT:5432} -[testenv:py{38,39,310,311,312}-dj{42,50,51,main}-postgis] +[testenv:py{38,39,310,311,312,313}-dj{42,50,51,main}-postgis] setenv = {[testenv]setenv} DB_BACKEND = postgis DB_PORT = {env:DB_PORT:5432} -[testenv:py{38,39,310,311,312}-dj{42,50,51,main}-mysql] +[testenv:py{38,39,310,311,312,313}-dj{42,50,51,main}-mysql] setenv = {[testenv]setenv} DB_BACKEND = mysql DB_PORT = {env:DB_PORT:3306} -[testenv:py{38,39,310,311,312}-dj{42,50,51,main}-sqlite] +[testenv:py{38,39,310,311,312,313}-dj{42,50,51,main}-sqlite] setenv = {[testenv]setenv} DB_BACKEND = sqlite3 @@ -99,6 +99,7 @@ python = 3.10: py310 3.11: py311 3.12: py312 + 3.13: py313 [gh-actions:env] DB_BACKEND = From b97ffed8fc1854e7a914d4c812e8f925a4f4d5eb Mon Sep 17 00:00:00 2001 From: Abeed Visram Date: Thu, 10 Oct 2024 11:00:39 +0100 Subject: [PATCH 2/5] Removed support for Python 3.8 end of life --- .github/workflows/release.yml | 2 +- .github/workflows/test.yml | 8 ++++---- debug_toolbar/toolbar.py | 4 +--- docs/changes.rst | 3 ++- pyproject.toml | 3 +-- tox.ini | 7 ++++--- 6 files changed, 13 insertions(+), 14 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b57181444..8931a446f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,7 +18,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: 3.8 + python-version: 3.9 - name: Install dependencies run: | diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4f313a92b..cf68bcce2 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', '3.12', '3.13'] + python-version: ['3.9', '3.10', '3.11', '3.12', '3.13'] services: mariadb: @@ -73,7 +73,7 @@ jobs: fail-fast: false max-parallel: 5 matrix: - python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] + python-version: ['3.9', '3.10', '3.11', '3.12', '3.13'] database: [postgresql, postgis] # Add psycopg3 to our matrix for modern python versions include: @@ -148,7 +148,7 @@ jobs: fail-fast: false max-parallel: 5 matrix: - python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] + python-version: ['3.9', '3.10', '3.11', '3.12', '3.13'] steps: - uses: actions/checkout@v4 @@ -195,7 +195,7 @@ jobs: - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: - python-version: 3.8 + python-version: 3.9 - name: Get pip cache dir id: pip-cache diff --git a/debug_toolbar/toolbar.py b/debug_toolbar/toolbar.py index 5c6b5cb7b..432a1f578 100644 --- a/debug_toolbar/toolbar.py +++ b/debug_toolbar/toolbar.py @@ -4,11 +4,9 @@ import re import uuid +from collections import OrderedDict from functools import lru_cache -# Can be removed when python3.8 is dropped -from typing import OrderedDict - from django.apps import apps from django.conf import settings from django.core.exceptions import ImproperlyConfigured diff --git a/docs/changes.rst b/docs/changes.rst index 584ff7407..e64940eca 100644 --- a/docs/changes.rst +++ b/docs/changes.rst @@ -4,7 +4,8 @@ Change log Pending ------- -* Added support for Python 3.13 and to the CI matrix. +* Added support for Python 3.13 to the CI matrix. +* Removed support for Python 3.8 as it is end of life. 5.0.0-alpha (2024-09-01) ------------------------ diff --git a/pyproject.toml b/pyproject.toml index a4c687dcf..57b0fc464 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,7 +12,7 @@ license = { text = "BSD-3-Clause" } authors = [ { name = "Rob Hudson" }, ] -requires-python = ">=3.8" +requires-python = ">=3.9" classifiers = [ "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", @@ -25,7 +25,6 @@ classifiers = [ "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", diff --git a/tox.ini b/tox.ini index c27ee4b04..5a2b94c64 100644 --- a/tox.ini +++ b/tox.ini @@ -3,8 +3,9 @@ isolated_build = true envlist = docs packaging - py{38,39,310,311,312,313}-dj{42}-{sqlite,postgresql,postgis,mysql} - py{310,311,312,313}-dj{42,50,51,main}-{sqlite,postgresql,psycopg3,postgis,mysql} + py{39,310,311,312}-dj{42}-{sqlite,postgresql,postgis,mysql} + py{310,311,312}-dj{42,50,51,main}-{sqlite,postgresql,psycopg3,postgis,mysql} + py{313}-dj{51,main}-{sqlite,postgresql,psycopg3,postgis,mysql} [testenv] deps = @@ -94,7 +95,6 @@ skip_install = true [gh-actions] python = - 3.8: py38 3.9: py39 3.10: py310 3.11: py311 @@ -105,6 +105,7 @@ python = DB_BACKEND = mysql: mysql postgresql: postgresql + psycopg: psycopg psycopg3: psycopg3 postgis: postgis sqlite3: sqlite From b4de1d57fc5babb7118ab1eca8205aa0a0e760ed Mon Sep 17 00:00:00 2001 From: Abeed Visram Date: Fri, 11 Oct 2024 07:02:05 +0100 Subject: [PATCH 3/5] Removing py3.8 from test runs and separating out 3.13 due to Django version compatibility --- .github/workflows/test.yml | 3 +-- docs/changes.rst | 4 ++-- pyproject.toml | 1 - tox.ini | 42 ++++++++++++++++++++++++++++++++------ 4 files changed, 39 insertions(+), 11 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cf68bcce2..c8bc2c600 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -84,8 +84,7 @@ jobs: - python-version: '3.12' database: psycopg3 - python-version: '3.13' - # psycopg installs version 3+; psycopg3 not found via pip in python 3.13 - database: psycopg + database: psycopg3 services: postgres: diff --git a/docs/changes.rst b/docs/changes.rst index e64940eca..4bb54144b 100644 --- a/docs/changes.rst +++ b/docs/changes.rst @@ -4,8 +4,8 @@ Change log Pending ------- -* Added support for Python 3.13 to the CI matrix. -* Removed support for Python 3.8 as it is end of life. +* Added Python 3.13 to the CI matrix. +* Removed support for Python 3.8 as it has reached end of life. 5.0.0-alpha (2024-09-01) ------------------------ diff --git a/pyproject.toml b/pyproject.toml index 57b0fc464..437f86108 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,7 +29,6 @@ classifiers = [ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", - "Programming Language :: Python :: 3.13", "Topic :: Software Development :: Libraries :: Python Modules", ] dynamic = [ diff --git a/tox.ini b/tox.ini index 5a2b94c64..052198413 100644 --- a/tox.ini +++ b/tox.ini @@ -5,7 +5,7 @@ envlist = packaging py{39,310,311,312}-dj{42}-{sqlite,postgresql,postgis,mysql} py{310,311,312}-dj{42,50,51,main}-{sqlite,postgresql,psycopg3,postgis,mysql} - py{313}-dj{51,main}-{sqlite,postgresql,psycopg3,postgis,mysql} + py{313}-dj{51,main}-{sqlite,psycopg3,mysql} [testenv] deps = @@ -16,6 +16,7 @@ deps = postgresql: psycopg2-binary psycopg3: psycopg[binary] postgis: psycopg2-binary + postgis3: psycopg[binary] mysql: mysqlclient coverage[toml] Jinja2 @@ -50,33 +51,62 @@ pip_pre = True commands = python -b -W always -m coverage run -m django test -v2 {posargs:tests} -[testenv:py{38,39,310,311,312,313}-dj{42,50,51,main}-{postgresql,psycopg3}] +[testenv:py{39,310,311,312}-dj{42,50,51,main}-{postgresql,psycopg3}] setenv = {[testenv]setenv} DB_BACKEND = postgresql DB_PORT = {env:DB_PORT:5432} -[testenv:py{38,39,310,311,312,313}-dj{42,50,51,main}-postgis] +[testenv:py{39,310,311,312}-dj{42,50,51,main}-postgis] setenv = {[testenv]setenv} DB_BACKEND = postgis DB_PORT = {env:DB_PORT:5432} -[testenv:py{38,39,310,311,312,313}-dj{42,50,51,main}-mysql] +[testenv:py{39,310,311,312}-dj{42,50,51,main}-mysql] setenv = {[testenv]setenv} DB_BACKEND = mysql DB_PORT = {env:DB_PORT:3306} -[testenv:py{38,39,310,311,312,313}-dj{42,50,51,main}-sqlite] +[testenv:py{39,310,311,312}-dj{42,50,51,main}-sqlite] setenv = {[testenv]setenv} DB_BACKEND = sqlite3 DB_NAME = ":memory:" + +[testenv:py313-dj{51,main}-psycopg3] +setenv = + {[testenv]setenv} + DB_BACKEND = postgresql + DB_PORT = {env:DB_PORT:5432} + + +[testenv:py313-dj{51,main}-postgis3] +setenv = + {[testenv]setenv} + DB_BACKEND = postgis + DB_PORT = {env:DB_PORT:5432} + + +[testenv:py313-dj{51,main}-mysql] +setenv = + {[testenv]setenv} + DB_BACKEND = mysql + DB_PORT = {env:DB_PORT:3306} + + +[testenv:py313-dj{51,main}-sqlite] +setenv = + {[testenv]setenv} + DB_BACKEND = sqlite3 + DB_NAME = ":memory:" + + [testenv:docs] commands = make -C {toxinidir}/docs {posargs:spelling} deps = @@ -105,7 +135,7 @@ python = DB_BACKEND = mysql: mysql postgresql: postgresql - psycopg: psycopg psycopg3: psycopg3 postgis: postgis + postgis3: postgis3 sqlite3: sqlite From c2c88c753c34c6838a8cb24d48277c49a95ea127 Mon Sep 17 00:00:00 2001 From: Matthias Kestenholz Date: Sun, 13 Oct 2024 14:50:33 +0200 Subject: [PATCH 4/5] Only use modern database adapters with Python 3.13 --- .github/workflows/test.yml | 5 ++++- tox.ini | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c8bc2c600..a2ded4678 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -73,7 +73,8 @@ jobs: fail-fast: false max-parallel: 5 matrix: - python-version: ['3.9', '3.10', '3.11', '3.12', '3.13'] + # Skip 3.13 here, it needs the psycopg3 / postgis3 database + python-version: ['3.9', '3.10', '3.11', '3.12'] database: [postgresql, postgis] # Add psycopg3 to our matrix for modern python versions include: @@ -85,6 +86,8 @@ jobs: database: psycopg3 - python-version: '3.13' database: psycopg3 + - python-version: '3.13' + database: postgis3 services: postgres: diff --git a/tox.ini b/tox.ini index 052198413..24ea6b5ae 100644 --- a/tox.ini +++ b/tox.ini @@ -5,7 +5,7 @@ envlist = packaging py{39,310,311,312}-dj{42}-{sqlite,postgresql,postgis,mysql} py{310,311,312}-dj{42,50,51,main}-{sqlite,postgresql,psycopg3,postgis,mysql} - py{313}-dj{51,main}-{sqlite,psycopg3,mysql} + py{313}-dj{51,main}-{sqlite,psycopg3,postgis3,mysql} [testenv] deps = From 441d696e3021c91711c39fa5b4b284ed609aec45 Mon Sep 17 00:00:00 2001 From: Matthias Kestenholz Date: Sun, 13 Oct 2024 14:54:33 +0200 Subject: [PATCH 5/5] Clean up the tox.ini definitions --- tox.ini | 36 ++++-------------------------------- 1 file changed, 4 insertions(+), 32 deletions(-) diff --git a/tox.ini b/tox.ini index 24ea6b5ae..0c9b26b2f 100644 --- a/tox.ini +++ b/tox.ini @@ -51,56 +51,28 @@ pip_pre = True commands = python -b -W always -m coverage run -m django test -v2 {posargs:tests} -[testenv:py{39,310,311,312}-dj{42,50,51,main}-{postgresql,psycopg3}] +[testenv:py{39,310,311,312,313}-dj{42,50,51,main}-{postgresql,psycopg3}] setenv = {[testenv]setenv} DB_BACKEND = postgresql DB_PORT = {env:DB_PORT:5432} -[testenv:py{39,310,311,312}-dj{42,50,51,main}-postgis] +[testenv:py{39,310,311,312,313}-dj{42,50,51,main}-{postgis,postgis3}] setenv = {[testenv]setenv} DB_BACKEND = postgis DB_PORT = {env:DB_PORT:5432} -[testenv:py{39,310,311,312}-dj{42,50,51,main}-mysql] +[testenv:py{39,310,311,312,313}-dj{42,50,51,main}-mysql] setenv = {[testenv]setenv} DB_BACKEND = mysql DB_PORT = {env:DB_PORT:3306} -[testenv:py{39,310,311,312}-dj{42,50,51,main}-sqlite] -setenv = - {[testenv]setenv} - DB_BACKEND = sqlite3 - DB_NAME = ":memory:" - - -[testenv:py313-dj{51,main}-psycopg3] -setenv = - {[testenv]setenv} - DB_BACKEND = postgresql - DB_PORT = {env:DB_PORT:5432} - - -[testenv:py313-dj{51,main}-postgis3] -setenv = - {[testenv]setenv} - DB_BACKEND = postgis - DB_PORT = {env:DB_PORT:5432} - - -[testenv:py313-dj{51,main}-mysql] -setenv = - {[testenv]setenv} - DB_BACKEND = mysql - DB_PORT = {env:DB_PORT:3306} - - -[testenv:py313-dj{51,main}-sqlite] +[testenv:py{39,310,311,312,313}-dj{42,50,51,main}-sqlite] setenv = {[testenv]setenv} DB_BACKEND = sqlite3