Skip to content

Commit

Permalink
Adding in support for Python 3.13 (#2014)
Browse files Browse the repository at this point in the history
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 <mk@feinheit.ch>
  • Loading branch information
abeed-avayu and matthiask authored Oct 13, 2024
1 parent 244d4fd commit 22c92e4
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions debug_toolbar/toolbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions docs/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)
------------------------

Expand Down
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
16 changes: 10 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand All @@ -15,6 +16,7 @@ deps =
postgresql: psycopg2-binary
psycopg3: psycopg[binary]
postgis: psycopg2-binary
postgis3: psycopg[binary]
mysql: mysqlclient
coverage[toml]
Jinja2
Expand Down Expand Up @@ -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 =
Expand All @@ -94,16 +97,17 @@ 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 =
mysql: mysql
postgresql: postgresql
psycopg3: psycopg3
postgis: postgis
postgis3: postgis3
sqlite3: sqlite

0 comments on commit 22c92e4

Please sign in to comment.