From 22c92e493cae2c96f72ce0021a43405fe1f084c9 Mon Sep 17 00:00:00 2001 From: abeed-avayu <124783973+abeed-avayu@users.noreply.github.com> Date: Sun, 13 Oct 2024 14:02:54 +0100 Subject: [PATCH] Adding in support for Python 3.13 (#2014) Shout-out to London Django Meetup for the Hacktoberfest Hackathon inspiration. Removed support for Python 3.8 end of life Co-authored-by: Matthias Kestenholz --- .github/workflows/release.yml | 2 +- .github/workflows/test.yml | 13 +++++++++---- debug_toolbar/toolbar.py | 4 +--- docs/changes.rst | 3 +++ pyproject.toml | 3 +-- tox.ini | 16 ++++++++++------ 6 files changed, 25 insertions(+), 16 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 cd5d8dd8b..a2ded4678 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.9', '3.10', '3.11', '3.12', '3.13'] services: mariadb: @@ -73,7 +73,8 @@ jobs: fail-fast: false max-parallel: 5 matrix: - python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] + # 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: @@ -83,6 +84,10 @@ jobs: database: psycopg3 - python-version: '3.12' database: psycopg3 + - python-version: '3.13' + database: psycopg3 + - python-version: '3.13' + database: postgis3 services: postgres: @@ -145,7 +150,7 @@ jobs: fail-fast: false max-parallel: 5 matrix: - python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] + python-version: ['3.9', '3.10', '3.11', '3.12', '3.13'] steps: - uses: actions/checkout@v4 @@ -192,7 +197,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 abf709b45..4bb54144b 100644 --- a/docs/changes.rst +++ b/docs/changes.rst @@ -4,6 +4,9 @@ Change log Pending ------- +* 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 611015e13..437f86108 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 1bba8d38f..0c9b26b2f 100644 --- a/tox.ini +++ b/tox.ini @@ -3,8 +3,9 @@ isolated_build = true envlist = docs packaging - py{38,39,310,311,312}-dj{42}-{sqlite,postgresql,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,psycopg3,postgis3,mysql} [testenv] deps = @@ -15,6 +16,7 @@ deps = postgresql: psycopg2-binary psycopg3: psycopg[binary] postgis: psycopg2-binary + postgis3: psycopg[binary] mysql: mysqlclient coverage[toml] Jinja2 @@ -49,33 +51,34 @@ 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{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{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{38,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{38,39,310,311,312}-dj{42,50,51,main}-sqlite] +[testenv:py{39,310,311,312,313}-dj{42,50,51,main}-sqlite] setenv = {[testenv]setenv} DB_BACKEND = sqlite3 DB_NAME = ":memory:" + [testenv:docs] commands = make -C {toxinidir}/docs {posargs:spelling} deps = @@ -94,11 +97,11 @@ skip_install = true [gh-actions] python = - 3.8: py38 3.9: py39 3.10: py310 3.11: py311 3.12: py312 + 3.13: py313 [gh-actions:env] DB_BACKEND = @@ -106,4 +109,5 @@ DB_BACKEND = postgresql: postgresql psycopg3: psycopg3 postgis: postgis + postgis3: postgis3 sqlite3: sqlite