Skip to content

Commit 6c482d1

Browse files
build: drop python 3.9 support (#1427)
Signed-off-by: arielle <me@arielle.codes> Signed-off-by: Zenith <me@arielle.codes> Co-authored-by: vi <8530778+shiftinv@users.noreply.github.com>
1 parent d171173 commit 6c482d1

File tree

19 files changed

+32
-88
lines changed

19 files changed

+32
-88
lines changed

.github/actions/setup-env/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ inputs:
66
python-version:
77
description: The python version to install
88
required: false
9-
default: '3.9'
9+
default: '3.10'
1010
use-cached-uv-lock:
1111
description: Whether to download the uv lock cache.
1212
required: false

.github/workflows/create-release-pr.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
- name: Set up environment
4646
uses: ./.github/actions/setup-env
4747
with:
48-
python-version: 3.9
48+
python-version: 3.10
4949

5050
- name: Install dependencies
5151
run: uv sync --no-default-groups --group changelog

.github/workflows/release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
id: setup
2626
uses: ./.github/actions/setup-env
2727
with:
28-
python-version: 3.9
28+
python-version: 3.10
2929

3030
- name: Build package
3131
run: |

.readthedocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ formats:
66
build:
77
os: ubuntu-24.04
88
tools:
9-
python: "3.9"
9+
python: "3.10"
1010
jobs:
1111
create_environment:
1212
- asdf plugin add uv

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Key Features
2626
Installing
2727
----------
2828

29-
**Python 3.9 or higher is required.**
29+
**Python 3.10 or higher is required.**
3030

3131
To install the library without full voice support, you can just run the
3232
following command:

changelog/1394.breaking.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Python 3.8 support has been dropped.
1+
Drop support for Python 3.8 as it reached end of life in October 2024 and no longer receives security updates.

changelog/1427.breaking.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Drop support for Python 3.9 as it reached end of life in October 2025 and no longer receives security updates.

disnake/ext/commands/core.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,8 +393,7 @@ def callback(self, function: CommandCallback[CogT, Any, P, T]) -> None:
393393
str(e)
394394
+ ", please check all annotations are defined outside of TYPE_CHECKING blocks."
395395
)
396-
# todo: add name kw only argument once we use py310+
397-
raise NameError(msg) from None
396+
raise NameError(msg, name=e.name) from None
398397

399398
for param in params.values():
400399
if param.annotation is Greedy:

disnake/ext/commands/params.py

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010
import inspect
1111
import itertools
1212
import math
13-
import sys
1413
import types
1514
from abc import ABC, abstractmethod
1615
from collections.abc import Sequence
1716
from dataclasses import dataclass
1817
from enum import Enum, EnumMeta
18+
from types import EllipsisType, UnionType
1919
from typing import (
2020
TYPE_CHECKING,
2121
Any,
@@ -82,16 +82,6 @@
8282
P = TypeVar("P")
8383

8484

85-
if sys.version_info >= (3, 10):
86-
from types import EllipsisType, UnionType
87-
elif TYPE_CHECKING:
88-
EllipsisType = type(Ellipsis)
89-
UnionType = NoReturn
90-
91-
else:
92-
UnionType = object()
93-
EllipsisType = type(Ellipsis)
94-
9585
T = TypeVar("T")
9686
TypeT = TypeVar("TypeT", bound=type[Any])
9787
BotT = TypeVar("BotT", bound="disnake.Client", covariant=True)
@@ -356,10 +346,8 @@ def __call__(self) -> NoReturn:
356346
raise NotImplementedError
357347

358348
# support new union syntax for `Range[int, 1, 2] | None`
359-
if sys.version_info >= (3, 10):
360-
361-
def __or__(self, other):
362-
return Union[self, other]
349+
def __or__(self, other):
350+
return Union[self, other]
363351

364352

365353
if TYPE_CHECKING:

disnake/ext/commands/slash_core.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -310,8 +310,7 @@ def __init__(
310310
str(e)
311311
+ ", please check all annotations are defined outside of TYPE_CHECKING blocks."
312312
)
313-
# todo: add name kw only argument once we use py310+
314-
raise NameError(msg) from None
313+
raise NameError(msg, name=e.name) from None
315314

316315
self.docstring = utils.parse_docstring(func)
317316
desc_loc = Localized._cast(description, False)
@@ -485,8 +484,7 @@ def __init__(
485484
str(e)
486485
+ ", please check all annotations are defined outside of TYPE_CHECKING blocks."
487486
)
488-
# todo: add name kw only argument once we use py310+
489-
raise NameError(msg) from None
487+
raise NameError(msg, name=e.name) from None
490488

491489
self.docstring = utils.parse_docstring(func)
492490
desc_loc = Localized._cast(description, False)

0 commit comments

Comments
 (0)