Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Install uv
uses: astral-sh/setup-uv@v8.1.0
with:
python-version: "3.10"
python-version: "3.11"

- name: Install Python tools
run: uv tool install "poethepoet>=0.26,<0.47.0"
Expand All @@ -42,10 +42,10 @@ jobs:
fail-fast: false
matrix:
platform: [ubuntu-latest, windows-latest]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
python-version: ["3.11", "3.12", "3.13", "3.14"]
runs-on: ${{ matrix.platform }}
env:
IS_MAIN_PYTHON: ${{ matrix.python-version == '3.10' && matrix.platform == 'ubuntu-latest' }}
IS_MAIN_PYTHON: ${{ matrix.python-version == '3.11' && matrix.platform == 'ubuntu-latest' }}
steps:
- uses: actions/checkout@v5
- name: Install uv
Expand Down Expand Up @@ -162,7 +162,7 @@ jobs:
--extra fetchart \
--extra chroma \
--extra sonosupdate
poe test
poe test -k 'not test_convert_rst_to_md'

- if: ${{ env.IS_MAIN_PYTHON == 'true' }}
name: Test with coverage
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/integration_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
- cron: "0 0 * * SUN" # run every Sunday at midnight

env:
PYTHON_VERSION: "3.10"
PYTHON_VERSION: "3.11"

jobs:
test_integration:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ concurrency:
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

env:
PYTHON_VERSION: "3.10"
PYTHON_VERSION: "3.11"

jobs:
changed-files:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/make_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
type: string

env:
PYTHON_VERSION: "3.10"
PYTHON_VERSION: "3.11"
NEW_VERSION: ${{ inputs.version }}
NEW_TAG: v${{ inputs.version }}

Expand Down
18 changes: 7 additions & 11 deletions beets/dbcore/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from functools import cached_property
from itertools import islice
from pathlib import Path
from sqlite3 import Connection, sqlite_version_info
from sqlite3 import Connection
from typing import (
TYPE_CHECKING,
Any,
Expand All @@ -26,14 +26,12 @@
Generic,
Literal,
NamedTuple,
Self,
TypedDict,
overload,
)

from typing_extensions import (
Self,
TypeVar, # default value support
)
from typing_extensions import TypeVar # default value support
from unidecode import unidecode

import beets
Expand Down Expand Up @@ -1250,12 +1248,10 @@ def bytelower(bytestring: AnyStr | None) -> AnyStr | None:

return bytestring

create_function = conn.create_function
if sys.version_info >= (3, 8) and sqlite_version_info >= (3, 8, 3):
# Let sqlite make extra optimizations
create_function = functools.partial(
conn.create_function, deterministic=True
)
# Let sqlite make extra optimizations
create_function = functools.partial(
conn.create_function, deterministic=True
)

create_function("regexp", 2, regexp)
create_function("unidecode", 1, unidecode)
Expand Down
7 changes: 3 additions & 4 deletions beets/importer/actions.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
from __future__ import annotations

from enum import Enum

from typing_extensions import Self
from enum import Enum, StrEnum
from typing import Self


class Action(Enum):
Expand All @@ -22,7 +21,7 @@ class Action(Enum):
# match, so the user can clean up files without restarting the import.


class DuplicateAction(str, Enum):
class DuplicateAction(StrEnum):
text: str

def __new__(cls, code: str, text: str) -> Self:
Expand Down
4 changes: 1 addition & 3 deletions beets/importer/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
import pickle
from bisect import bisect_left, insort
from dataclasses import dataclass
from typing import TYPE_CHECKING

from typing_extensions import Self
from typing import TYPE_CHECKING, Self

from beets import config

Expand Down
3 changes: 1 addition & 2 deletions beets/library/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@
from contextlib import suppress
from functools import cached_property
from pathlib import Path
from typing import TYPE_CHECKING, Any, ClassVar, TypeVar
from typing import TYPE_CHECKING, Any, ClassVar, Self, TypeVar

from mediafile import MediaFile, UnreadableFileError
from typing_extensions import Self

import beets
from beets import dbcore, logging, plugins, util
Expand Down
12 changes: 10 additions & 2 deletions beets/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,18 @@
from functools import cached_property, wraps
from importlib import import_module
from pathlib import Path
from typing import TYPE_CHECKING, Any, ClassVar, TypeVar, overload
from typing import (
TYPE_CHECKING,
Any,
ClassVar,
Never,
ParamSpec,
TypeVar,
Unpack,
overload,
)

import mediafile
from typing_extensions import Never, ParamSpec, Unpack

import beets
from beets import logging
Expand Down
2 changes: 1 addition & 1 deletion beets/test/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@
if TYPE_CHECKING:
from collections.abc import Iterable, Iterator, Sequence
from types import TracebackType
from typing import Self
from unittest.mock import _patch

from confuse import ConfigSource
from requests_mock.mocker import Mocker
from typing_extensions import Self

from beets.autotag import AlbumMatch, TrackMatch
from beets.library import Album
Expand Down
4 changes: 1 addition & 3 deletions beets/ui/commands/modify.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

from __future__ import annotations

from typing import TYPE_CHECKING, NamedTuple, Protocol, TypedDict

from typing_extensions import Unpack
from typing import TYPE_CHECKING, NamedTuple, Protocol, TypedDict, Unpack

from beets import ui
from beets.dbcore import types
Expand Down
2 changes: 1 addition & 1 deletion beets/util/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@
Generic,
Literal,
NamedTuple,
Self,
TypeVar,
cast,
overload,
)

import confuse
from confuse import Optional
from typing_extensions import Self
from unidecode import unidecode

import beets
Expand Down
20 changes: 14 additions & 6 deletions beets/util/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,17 @@
import queue
import sys
from threading import Lock, Thread
from typing import TYPE_CHECKING, Any, Generic, overload

from typing_extensions import ParamSpec, TypeVar, TypeVarTuple, Unpack
from typing import (
TYPE_CHECKING,
Any,
Generic,
ParamSpec,
TypeVarTuple,
Unpack,
overload,
)

from typing_extensions import TypeVar

if TYPE_CHECKING:
from collections.abc import (
Expand Down Expand Up @@ -192,7 +200,7 @@ def stage(
[3, 4, 5]
"""

def coro(*args: Unpack[A]) -> Generator[R | T | None, T, None]:
def coro(*args: *A) -> Generator[R | T | None, T, None]:
task: R | T | None = None
while True:
task = yield task
Expand All @@ -218,7 +226,7 @@ def mutator_stage(
[{'x': True}, {'a': False, 'x': True}]
"""

def coro(*args: Unpack[A]) -> Generator[T | None, T, None]:
def coro(*args: *A) -> Generator[T | None, T, None]:
task = None
while True:
task = yield task
Expand Down Expand Up @@ -433,7 +441,7 @@ class Pipeline(Generic[Tpull, Tstage]):

@overload
def __init__(
self, stages: tuple[Unpack[StagePrefix], Generator[Tpull, Any, Any]]
self, stages: tuple[*StagePrefix, Generator[Tpull, Any, Any]]
) -> None: ...

@overload
Expand Down
4 changes: 2 additions & 2 deletions beetsplug/_typing.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from __future__ import annotations

from typing import Any
from typing import Any, NotRequired

from typing_extensions import NotRequired, TypedDict
from typing_extensions import TypedDict

JSONDict = dict[str, Any]

Expand Down
3 changes: 2 additions & 1 deletion beetsplug/_utils/musicbrainz.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@
Any,
ClassVar,
Literal,
NotRequired,
ParamSpec,
TypedDict,
TypeVar,
Unpack,
)

from requests_ratelimiter import LimiterMixin
from typing_extensions import NotRequired, Unpack

from beets import config, logging

Expand Down
4 changes: 1 addition & 3 deletions beetsplug/_utils/playcount.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
from __future__ import annotations

from typing import TYPE_CHECKING, TypedDict

from typing_extensions import NotRequired
from typing import TYPE_CHECKING, NotRequired, TypedDict

from beets.dbcore import AndQuery, MatchQuery, OrQuery
from beets.dbcore.query import StringQuery, SubstringQuery
Expand Down
3 changes: 1 addition & 2 deletions beetsplug/aura.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import re
from dataclasses import dataclass
from mimetypes import guess_type
from typing import TYPE_CHECKING, Any, ClassVar, Protocol
from typing import TYPE_CHECKING, Any, ClassVar, Protocol, Self

from flask import (
Blueprint,
Expand All @@ -16,7 +16,6 @@
request,
send_file,
)
from typing_extensions import Self

from beets import config
from beets.dbcore import AndQuery, MatchQuery
Expand Down
4 changes: 2 additions & 2 deletions beetsplug/discogs/types.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from __future__ import annotations

from typing import TYPE_CHECKING, Literal
from typing import TYPE_CHECKING, Literal, NotRequired

from typing_extensions import NotRequired, TypedDict
from typing_extensions import TypedDict

if TYPE_CHECKING:
from beets.autotag import TrackInfo
Expand Down
4 changes: 2 additions & 2 deletions beetsplug/mbpseudo.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
import itertools
from copy import deepcopy
from functools import cached_property
from typing import TYPE_CHECKING, Any
from typing import TYPE_CHECKING, Any, Self

import mediafile
from typing_extensions import Self, override
from typing_extensions import override

from beets import config
from beets.autotag import AlbumInfo, Source, assign_items, distance
Expand Down
11 changes: 9 additions & 2 deletions beetsplug/mpdstats.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,17 @@

import os
import time
from typing import TYPE_CHECKING, Any, ClassVar, Literal, TypedDict, overload
from typing import (
TYPE_CHECKING,
Any,
ClassVar,
Literal,
NotRequired,
TypedDict,
overload,
)

import mpd
from typing_extensions import NotRequired

from beets import config, plugins, ui
from beets.dbcore import types
Expand Down
3 changes: 1 addition & 2 deletions beetsplug/musicbrainz.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@
from contextlib import suppress
from functools import cached_property
from itertools import product
from typing import TYPE_CHECKING, Literal, TypedDict
from typing import TYPE_CHECKING, Literal, NotRequired, TypedDict
from urllib.parse import urljoin

from confuse.exceptions import NotFoundError
from typing_extensions import NotRequired

from beets import config, plugins, util
from beets.autotag import AlbumInfo, TrackInfo
Expand Down
4 changes: 1 addition & 3 deletions beetsplug/tidal/api_types.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
from __future__ import annotations

from typing import Generic, Literal, TypedDict, TypeVar

from typing_extensions import NotRequired
from typing import Generic, Literal, NotRequired, TypedDict, TypeVar


class ResourceIdentifier(TypedDict):
Expand Down
3 changes: 3 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ below!
Unreleased
----------

Beets now requires Python 3.11 or later since support for EOL Python 3.10 has
been dropped.

New features
~~~~~~~~~~~~

Expand Down
2 changes: 1 addition & 1 deletion docs/extensions/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def resolve_xref(
target: str,
node: pending_xref,
contnode: Element,
) -> Element | None:
) -> nodes.reference | None:
if entry := self.data["objects"].get(target):
docname, targetid = entry
return make_refnode(
Expand Down
Loading
Loading