mirror of
https://github.com/beetbox/beets.git
synced 2025-12-15 21:14:19 +01:00
Use typing_extensions only when needed
Self was added in Python 3.11 TypeAlias was added in Python 3.10
This commit is contained in:
parent
a273807569
commit
859072ee9e
4 changed files with 13 additions and 3 deletions
|
|
@ -45,7 +45,11 @@ from typing import (
|
|||
Union,
|
||||
)
|
||||
|
||||
from typing_extensions import TypeAlias
|
||||
try:
|
||||
# Python 3.10+
|
||||
from typing import TypeAlias
|
||||
except ImportError:
|
||||
from typing_extensions import TypeAlias
|
||||
from unidecode import unidecode
|
||||
|
||||
from beets.util import hidden
|
||||
|
|
|
|||
|
|
@ -29,7 +29,12 @@ from flask import (
|
|||
request,
|
||||
send_file,
|
||||
)
|
||||
from typing_extensions import Self
|
||||
|
||||
try:
|
||||
# Python 3.11+
|
||||
from typing import Self
|
||||
except ImportError:
|
||||
from typing_extensions import Self
|
||||
|
||||
from beets import config
|
||||
from beets.dbcore.query import (
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ For packagers:
|
|||
|
||||
* The minimum supported Python version is now 3.8.
|
||||
* The `beet` script has been removed from the repository.
|
||||
* The `typing_extensions` is required for Python 3.10 and below.
|
||||
|
||||
Other changes:
|
||||
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ mediafile = ">=0.12.0"
|
|||
munkres = ">=1.0.0"
|
||||
musicbrainzngs = ">=0.4"
|
||||
pyyaml = "*"
|
||||
typing_extensions = "*"
|
||||
typing_extensions = { version = "*", python = "<=3.10" }
|
||||
unidecode = ">=1.3.6"
|
||||
beautifulsoup4 = { version = "*", optional = true }
|
||||
dbus-python = { version = "*", optional = true }
|
||||
|
|
|
|||
Loading…
Reference in a new issue