Skip to content

Commit 6bcecb2

Browse files
authored
build: support Python 3.13 (#1263)
1 parent 18535bb commit 6bcecb2

File tree

5 files changed

+18
-5
lines changed

5 files changed

+18
-5
lines changed

.github/workflows/lint-test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ jobs:
5454
runs-on: ubuntu-latest
5555
strategy:
5656
matrix:
57+
# FIXME: using specific patch version for 3.12 due to pdm bug
5758
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12.7"]
5859
experimental: [false]
5960
fail-fast: false

changelog/1263.misc.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Support Python 3.13.

disnake/player.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,14 @@
2525

2626
from .voice_client import VoiceClient
2727

28-
with warnings.catch_warnings():
29-
warnings.simplefilter("ignore", DeprecationWarning)
30-
import audioop
28+
try:
29+
with warnings.catch_warnings():
30+
warnings.simplefilter("ignore", DeprecationWarning)
31+
import audioop
32+
33+
has_audioop = True
34+
except ImportError:
35+
has_audioop = False
3136

3237
MISSING = utils.MISSING
3338

@@ -660,6 +665,11 @@ class PCMVolumeTransformer(AudioSource, Generic[AT]):
660665
"""
661666

662667
def __init__(self, original: AT, volume: float = 1.0) -> None:
668+
if not has_audioop:
669+
raise RuntimeError(
670+
f"audioop-lts library needed in Python >=3.13 in order to use {type(self).__name__}"
671+
)
672+
663673
if not isinstance(original, AudioSource):
664674
raise TypeError(f"expected AudioSource not {original.__class__.__name__}.")
665675

noxfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ def pyright(session: nox.Session) -> None:
202202
pass
203203

204204

205-
@nox.session(python=["3.8", "3.9", "3.10", "3.11", "3.12"])
205+
@nox.session(python=["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"])
206206
@nox.parametrize(
207207
"extras",
208208
[

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ classifiers = [
2828
"Programming Language :: Python :: 3.10",
2929
"Programming Language :: Python :: 3.11",
3030
"Programming Language :: Python :: 3.12",
31+
"Programming Language :: Python :: 3.13",
3132
"Topic :: Internet",
3233
"Topic :: Software Development :: Libraries",
3334
"Topic :: Software Development :: Libraries :: Python Modules",
@@ -51,6 +52,7 @@ speed = [
5152
]
5253
voice = [
5354
"PyNaCl>=1.5.0,<1.6",
55+
'audioop-lts==0.2.1; python_version >= "3.13"'
5456
]
5557
docs = [
5658
"sphinx==7.0.1",
@@ -125,7 +127,6 @@ runner = "pdm run"
125127

126128
[tool.black]
127129
line-length = 100
128-
target-version = ["py38", "py39", "py310", "py311", "py312"]
129130

130131
[tool.ruff]
131132
line-length = 100

0 commit comments

Comments
 (0)