Skip to content

Commit a1e750f

Browse files
Bye Python 39 (#2254)
Co-authored-by: Tim Schilling <[email protected]>
1 parent 4ae39f9 commit a1e750f

File tree

8 files changed

+16
-21
lines changed

8 files changed

+16
-21
lines changed

.github/workflows/test.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
fail-fast: false
2222
max-parallel: 5
2323
matrix:
24-
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
24+
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
2525

2626
services:
2727
mariadb:
@@ -91,11 +91,9 @@ jobs:
9191
fail-fast: false
9292
max-parallel: 5
9393
matrix:
94-
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
94+
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
9595
database: [postgresql, postgis, psycopg3]
9696
exclude:
97-
- python-version: '3.9'
98-
database: psycopg3
9997
- python-version: '3.13'
10098
database: postgis
10199
- python-version: '3.13'
@@ -192,7 +190,7 @@ jobs:
192190
fail-fast: false
193191
max-parallel: 5
194192
matrix:
195-
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
193+
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
196194

197195
steps:
198196
- uses: actions/checkout@v5
@@ -252,7 +250,7 @@ jobs:
252250
- name: Set up Python ${{ matrix.python-version }}
253251
uses: actions/setup-python@v6
254252
with:
255-
python-version: 3.9
253+
python-version: '3.10'
256254

257255
- name: Get pip cache dir
258256
id: pip-cache

debug_toolbar/_stubs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from __future__ import annotations
22

3-
from typing import Any, NamedTuple, Optional, Protocol
3+
from typing import Any, NamedTuple, Protocol
44

55
from django import template as dj_template
66
from django.http import HttpRequest, HttpResponse
@@ -15,7 +15,7 @@ class InspectStack(NamedTuple):
1515
index: int
1616

1717

18-
TidyStackTrace = list[tuple[str, int, str, str, Optional[Any]]]
18+
TidyStackTrace = list[tuple[str, int, str, str, Any | None]]
1919

2020

2121
class RenderContext(dj_template.context.RenderContext):

debug_toolbar/middleware.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
import re
66
import socket
7+
from collections.abc import Callable
78
from functools import cache
8-
from typing import Callable
99

1010
from asgiref.sync import (
1111
async_to_sync,

debug_toolbar/toolbar.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
import logging
88
import re
99
import uuid
10+
from collections.abc import Callable
1011
from functools import cache
11-
from typing import Callable
1212

1313
from django.apps import apps
1414
from django.conf import settings

docs/changes.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Pending
1111
resources.
1212
* Show the cache backend alias and cache backend class name instead of
1313
the cache instance in the cache panel.
14+
* Dropped support for the Python 3.9, it has reached its end of life date.
1415

1516
6.1.0 (2025-10-30)
1617
------------------

pyproject.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ license = { text = "BSD-3-Clause" }
1212
authors = [
1313
{ name = "Rob Hudson" },
1414
]
15-
requires-python = ">=3.9"
15+
requires-python = ">=3.10"
1616
classifiers = [
1717
"Development Status :: 5 - Production/Stable",
1818
"Environment :: Web Environment",
@@ -25,7 +25,6 @@ classifiers = [
2525
"Operating System :: OS Independent",
2626
"Programming Language :: Python",
2727
"Programming Language :: Python :: 3 :: Only",
28-
"Programming Language :: Python :: 3.9",
2928
"Programming Language :: Python :: 3.10",
3029
"Programming Language :: Python :: 3.11",
3130
"Programming Language :: Python :: 3.12",
@@ -57,7 +56,7 @@ packages = [
5756
path = "debug_toolbar/__init__.py"
5857

5958
[tool.ruff]
60-
target-version = "py39"
59+
target-version = "py310"
6160

6261
fix = true
6362
show-fixes = true

tests/base.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import contextvars
2-
from typing import Optional
32

43
import html5lib
54
from asgiref.local import Local
@@ -70,7 +69,7 @@ class BaseMixin:
7069
client_class = ToolbarTestClient
7170
async_client_class = AsyncToolbarTestClient
7271

73-
panel: Optional[Panel] = None
72+
panel: Panel | None = None
7473
panel_id = None
7574

7675
def setUp(self):

tox.ini

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ isolated_build = true
33
envlist =
44
docs
55
packaging
6-
py{39,310,311,312}-dj{42}-{sqlite,postgresql,postgis,mysql}
76
py{310,311}-dj{42,51,52}-{sqlite,postgresql,psycopg3,postgis,mysql}
87
py{312}-dj{42,51,52,60}-{sqlite,postgresql,psycopg3,postgis,mysql}
98
py{313}-dj{51,52,60,main}-{sqlite,psycopg3,postgis3,mysql}
@@ -55,28 +54,28 @@ pip_pre = True
5554
commands = python -b -W always -m coverage run -m django test -v2 {posargs:tests}
5655

5756

58-
[testenv:py{39,310,311,312,313,314}-dj{42,51,52,60,main}-{postgresql,psycopg3}]
57+
[testenv:py{310,311,312,313,314}-dj{42,51,52,60,main}-{postgresql,psycopg3}]
5958
setenv =
6059
{[testenv]setenv}
6160
DB_BACKEND = postgresql
6261
DB_PORT = {env:DB_PORT:5432}
6362

6463

65-
[testenv:py{39,310,311,312,313,314}-dj{42,51,52,60,main}-{postgis,postgis3}]
64+
[testenv:py{310,311,312,313,314}-dj{42,51,52,60,main}-{postgis,postgis3}]
6665
setenv =
6766
{[testenv]setenv}
6867
DB_BACKEND = postgis
6968
DB_PORT = {env:DB_PORT:5432}
7069

7170

72-
[testenv:py{39,310,311,312,313,314}-dj{42,51,52,60,main}-mysql]
71+
[testenv:py{310,311,312,313,314}-dj{42,51,52,60,main}-mysql]
7372
setenv =
7473
{[testenv]setenv}
7574
DB_BACKEND = mysql
7675
DB_PORT = {env:DB_PORT:3306}
7776

7877

79-
[testenv:py{39,310,311,312,313,314}-dj{42,51,52,60,main}-sqlite]
78+
[testenv:py{310,311,312,313,314}-dj{42,51,52,60,main}-sqlite]
8079
setenv =
8180
{[testenv]setenv}
8281
DB_BACKEND = sqlite3
@@ -101,7 +100,6 @@ skip_install = true
101100

102101
[gh-actions]
103102
python =
104-
3.9: py39
105103
3.10: py310
106104
3.11: py311
107105
3.12: py312

0 commit comments

Comments
 (0)