Skip to content

Commit 9988ff4

Browse files
committed
Drop Python 3.9 support
It reached EOL on 2025-10-31: https://peps.python.org/pep-0596/#lifespan.
1 parent 894518f commit 9988ff4

File tree

16 files changed

+123
-230
lines changed

16 files changed

+123
-230
lines changed

.github/ISSUE_TEMPLATE/issue.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ body:
66
attributes:
77
label: Python Version
88
description: Which version of Python were you using?
9-
placeholder: 3.9.0
9+
placeholder: 3.14.0
1010
validations:
1111
required: false
1212
- type: input

.github/workflows/main.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ jobs:
2121
fail-fast: false
2222
matrix:
2323
python-version:
24-
- '3.9'
2524
- '3.10'
2625
- '3.11'
2726
- '3.12'

docs/changelog.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
Changelog
33
=========
44

5+
* Drop Python 3.9 support.
6+
57
4.19.0 (2025-09-18)
68
-------------------
79

docs/installation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Installation
44
Requirements
55
------------
66

7-
Python 3.9 to 3.14 supported.
7+
Python 3.10 to 3.14 supported.
88

99
Django 4.2 to 6.0 supported.
1010

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ license-files = [ "LICENSE" ]
1919
authors = [
2020
{ name = "Adam Johnson", email = "[email protected]" },
2121
]
22-
requires-python = ">=3.9"
22+
requires-python = ">=3.10"
2323
classifiers = [
2424
"Development Status :: 5 - Production/Stable",
2525
"Framework :: Django",
@@ -32,7 +32,6 @@ classifiers = [
3232
"Natural Language :: English",
3333
"Operating System :: OS Independent",
3434
"Programming Language :: Python :: 3 :: Only",
35-
"Programming Language :: Python :: 3.9",
3635
"Programming Language :: Python :: 3.10",
3736
"Programming Language :: Python :: 3.11",
3837
"Programming Language :: Python :: 3.12",

src/django_mysql/apps.py

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

3-
from typing import Any, Callable
3+
from collections.abc import Callable
4+
from typing import Any
45

56
from django.apps import AppConfig
67
from django.conf import settings

src/django_mysql/cache.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
import pickle
55
import re
66
import zlib
7-
from collections.abc import Iterable
7+
from collections.abc import Callable, Iterable
88
from random import random
99
from time import time
10-
from typing import Any, Callable, Literal, cast
10+
from typing import Any, Literal, cast
1111

1212
from django.core.cache.backends.base import DEFAULT_TIMEOUT, BaseCache, default_key_func
1313
from django.db import connections, router

src/django_mysql/models/fields/dynamic.py

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
import datetime as dt
44
import json
5-
from collections.abc import Iterable
6-
from typing import Any, Callable, Union, cast
5+
from collections.abc import Callable, Iterable
6+
from typing import Any, cast
77

88
from django.core import checks
99
from django.db.backends.base.base import BaseDatabaseWrapper
@@ -38,25 +38,21 @@
3838
# define this type to two levels deep.
3939
SpecDict = dict[
4040
str,
41-
Union[
42-
type[dt.date],
43-
type[dt.datetime],
44-
type[float],
45-
type[int],
46-
type[str],
47-
type[dt.time],
48-
dict[
49-
str,
50-
Union[
51-
type[dt.date],
52-
type[dt.datetime],
53-
type[float],
54-
type[int],
55-
type[str],
56-
type[dt.time],
57-
dict[str, Any],
58-
],
59-
],
41+
type[dt.date]
42+
| type[dt.datetime]
43+
| type[float]
44+
| type[int]
45+
| type[str]
46+
| type[dt.time]
47+
| dict[
48+
str,
49+
type[dt.date]
50+
| type[dt.datetime]
51+
| type[float]
52+
| type[int]
53+
| type[str]
54+
| type[dt.time]
55+
| dict[str, Any],
6056
],
6157
]
6258

src/django_mysql/models/fields/lists.py

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

3-
from collections.abc import Iterable
4-
from typing import Any, Callable, cast
3+
from collections.abc import Callable, Iterable
4+
from typing import Any, cast
55

66
from django.core import checks
77
from django.db.backends.base.base import BaseDatabaseWrapper

src/django_mysql/models/functions.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import datetime as dt
44
import json
5-
from typing import Any, Union
5+
from typing import Any, TypeAlias
66

77
from django.db import DEFAULT_DB_ALIAS, connections
88
from django.db.backends.base.base import BaseDatabaseWrapper
@@ -18,10 +18,7 @@
1818
from django.db.models import Field as DjangoField
1919
from django.db.models.sql.compiler import SQLCompiler
2020

21-
ExpressionArgument = Union[
22-
Expression,
23-
str, # column reference handled by Django
24-
]
21+
ExpressionArgument: TypeAlias = Expression | str
2522

2623

2724
class SingleArgFunc(Func):

0 commit comments

Comments
 (0)