Skip to content

Commit a625f9c

Browse files
authored
Merge pull request #75 from mopidy/ext-template-2.2.0
2 parents 60affec + 1e9c739 commit a625f9c

File tree

20 files changed

+64
-54
lines changed

20 files changed

+64
-54
lines changed

.copier-answers.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
_commit: v2.1.3
1+
_commit: v2.2.0
22
_src_path: gh:mopidy/mopidy-ext-template
33
author_email: [email protected]
44
author_full_name: Stein Magnus Jodal

.github/workflows/ci.yml

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,49 +5,47 @@ on:
55
push:
66
branches:
77
- main
8+
workflow_dispatch:
89

910
jobs:
1011
build:
1112
name: Build
1213
runs-on: ubuntu-24.04
1314
steps:
14-
- uses: actions/checkout@v4
15+
- uses: actions/checkout@v6
1516
- uses: hynek/build-and-inspect-python-package@v2
1617

1718
main:
1819
strategy:
1920
fail-fast: false
2021
matrix:
2122
include:
22-
- name: "pytest (3.11)"
23-
python: "3.11"
24-
tox: "3.11"
25-
- name: "pytest (3.12)"
26-
python: "3.12"
27-
tox: "3.12"
2823
- name: "pytest (3.13)"
2924
python: "3.13"
3025
tox: "3.13"
26+
- name: "pytest (3.14)"
27+
python: "3.14"
28+
tox: "3.14"
3129
coverage: true
3230
- name: "pyright"
33-
python: "3.13"
31+
python: "3.14"
3432
tox: "pyright"
3533
- name: "ruff check"
36-
python: "3.13"
34+
python: "3.14"
3735
tox: "ruff-check"
3836
- name: "ruff format"
39-
python: "3.13"
37+
python: "3.14"
4038
tox: "ruff-format"
4139

4240
name: ${{ matrix.name }}
4341
runs-on: ubuntu-24.04
4442
container: ghcr.io/mopidy/ci:latest
4543

4644
steps:
47-
- uses: actions/checkout@v4
45+
- uses: actions/checkout@v6
4846
- name: Fix home dir permissions to enable pip caching
4947
run: chown -R root /github/home
50-
- uses: actions/setup-python@v5
48+
- uses: actions/setup-python@v6
5149
with:
5250
python-version: ${{ matrix.python }}
5351
cache: pip

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
permissions:
1414
id-token: write
1515
steps:
16-
- uses: actions/checkout@v4
16+
- uses: actions/checkout@v6
1717
- uses: hynek/build-and-inspect-python-package@v2
1818
id: build
1919
- uses: actions/download-artifact@v4

pyproject.toml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "mopidy-mpd"
33
description = "Mopidy extension for controlling Mopidy from MPD clients"
44
readme = "README.md"
5-
requires-python = ">= 3.11"
5+
requires-python = ">= 3.13"
66
license = { text = "Apache-2.0" }
77
authors = [{ name = "Stein Magnus Jodal", email = "[email protected]" }]
88
classifiers = [
@@ -13,7 +13,11 @@ classifiers = [
1313
"Topic :: Multimedia :: Sound/Audio :: Players",
1414
]
1515
dynamic = ["version"]
16-
dependencies = ["mopidy >= 4.0.0a4", "pygobject >= 3.42", "pykka >= 4"]
16+
dependencies = [
17+
"mopidy >= 4.0.0a7",
18+
"pygobject >= 3.50",
19+
"pykka >= 4.1",
20+
]
1721

1822
[project.urls]
1923
Homepage = "https://github.com/mopidy/mopidy-mpd"
@@ -23,7 +27,7 @@ mpd = "mopidy_mpd:Extension"
2327

2428

2529
[build-system]
26-
requires = ["setuptools >= 66", "setuptools-scm >= 7.1"]
30+
requires = ["setuptools >= 78", "setuptools-scm >= 8.2"]
2731
build-backend = "setuptools.build_meta"
2832

2933

@@ -50,7 +54,7 @@ show_missing = true
5054

5155

5256
[tool.pyright]
53-
pythonVersion = "3.11"
57+
pythonVersion = "3.13"
5458
typeCheckingMode = "standard"
5559
# Not all dependencies have type hints:
5660
reportMissingTypeStubs = false
@@ -68,7 +72,7 @@ filterwarnings = [
6872

6973

7074
[tool.ruff]
71-
target-version = "py311"
75+
target-version = "py313"
7276

7377
[tool.ruff.lint]
7478
select = ["ALL"]
@@ -122,7 +126,13 @@ ignore = [
122126

123127

124128
[tool.tox]
125-
env_list = ["3.11", "3.12", "3.13", "pyright", "ruff-check", "ruff-format"]
129+
env_list = [
130+
"3.13",
131+
"3.14",
132+
"pyright",
133+
"ruff-check",
134+
"ruff-format",
135+
]
126136

127137
[tool.tox.env_run_base]
128138
package = "wheel"

src/mopidy_mpd/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ def get_config_schema(self) -> config.ConfigSchema:
2727
return schema
2828

2929
def setup(self, registry: ext.Registry) -> None:
30-
from .actor import MpdFrontend
30+
from .actor import MpdFrontend # noqa: PLC0415
3131

3232
registry.add("frontend", MpdFrontend)

src/mopidy_mpd/context.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,22 +65,20 @@ def __init__(
6565
@overload
6666
def browse(
6767
self, path: str | None, *, recursive: bool, lookup: Literal[True]
68-
) -> Generator[
69-
tuple[str, pykka.Future[dict[Uri, list[Track]]] | None], Any, None
70-
]: ...
68+
) -> Generator[tuple[str, pykka.Future[dict[Uri, list[Track]]] | None], Any]: ...
7169

7270
@overload
7371
def browse(
7472
self, path: str | None, *, recursive: bool, lookup: Literal[False]
75-
) -> Generator[tuple[str, Ref | None], Any, None]: ...
73+
) -> Generator[tuple[str, Ref | None], Any]: ...
7674

7775
def browse( # noqa: C901, PLR0912
7876
self,
7977
path: str | None,
8078
*,
8179
recursive: bool = True,
8280
lookup: bool = True,
83-
) -> Generator[Any, Any, None]:
81+
) -> Generator[Any, Any]:
8482
"""
8583
Browse the contents of a given directory path.
8684

src/mopidy_mpd/dispatcher.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
from typing import (
66
TYPE_CHECKING,
77
NewType,
8-
TypeAlias,
98
TypeVar,
109
)
1110

@@ -25,9 +24,9 @@
2524
protocol.load_protocol_modules()
2625

2726
T = TypeVar("T")
28-
Request: TypeAlias = str
27+
type Request = str
2928
Response = NewType("Response", list[str])
30-
Filter: TypeAlias = Callable[[Request, Response, list["Filter"]], Response]
29+
type Filter = Callable[[Request, Response, list["Filter"]], Response]
3130

3231

3332
class MpdDispatcher:

src/mopidy_mpd/network.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
from types import TracebackType
2121

2222
from mopidy.core import CoreProxy
23+
2324
from mopidy_mpd import types
2425
from mopidy_mpd.session import MpdSession, MpdSessionKwargs
2526
from mopidy_mpd.types import SocketAddress
@@ -502,7 +503,7 @@ def on_stop(self) -> None:
502503
"""Clean up connection resouces when actor stops."""
503504
self.connection.stop("Actor is shutting down.")
504505

505-
def parse_lines(self) -> Generator[bytes, Any, None]:
506+
def parse_lines(self) -> Generator[bytes, Any]:
506507
"""Consume new data and yield any lines found."""
507508
while re.search(self.terminator, self.recv_buffer):
508509
line, self.recv_buffer = self.delimiter.split(self.recv_buffer, 1)

src/mopidy_mpd/protocol/__init__.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
import inspect
1616
from collections.abc import Callable
17-
from typing import TYPE_CHECKING, Any, TypeAlias
17+
from typing import TYPE_CHECKING, Any
1818

1919
from mopidy_mpd import exceptions
2020

@@ -31,20 +31,20 @@
3131
VERSION = "0.19.0"
3232

3333

34-
ResultValue: TypeAlias = str | int
35-
ResultDict: TypeAlias = dict[str, ResultValue]
36-
ResultTuple: TypeAlias = tuple[str, ResultValue]
37-
ResultList: TypeAlias = list[ResultTuple | ResultDict]
38-
Result: TypeAlias = None | ResultDict | ResultTuple | ResultList
39-
HandlerFunc: TypeAlias = Callable[..., Result]
34+
type ResultValue = str | int
35+
type ResultDict = dict[str, ResultValue]
36+
type ResultTuple = tuple[str, ResultValue]
37+
type ResultList = list[ResultTuple | ResultDict]
38+
type Result = None | ResultDict | ResultTuple | ResultList
39+
type HandlerFunc = Callable[..., Result]
4040

4141

4242
def load_protocol_modules() -> None:
4343
"""
4444
The protocol modules must be imported to get them registered in
4545
:attr:`commands`.
4646
"""
47-
from . import ( # noqa: F401
47+
from . import ( # noqa: F401, PLC0415
4848
audio_output,
4949
channels,
5050
command_list,

src/mopidy_mpd/protocol/music_db.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@
44
from typing import TYPE_CHECKING, cast
55

66
from mopidy.models import Album, Artist, SearchResult, Track
7-
from mopidy.types import DistinctField, Query, SearchField, Uri
7+
88
from mopidy_mpd import exceptions, protocol, translator
99
from mopidy_mpd.protocol import stored_playlists
1010

1111
if TYPE_CHECKING:
1212
from collections.abc import Iterable, Sequence
1313

14+
from mopidy.types import DistinctField, Query, SearchField, Uri
15+
1416
from mopidy_mpd.context import MpdContext
1517

1618

@@ -67,7 +69,7 @@ def _query_for_search(parameters: Sequence[str]) -> Query[SearchField]:
6769
value = parameters.pop(0)
6870
if value.strip():
6971
query.setdefault(field, []).append(value)
70-
return cast(Query[SearchField], query)
72+
return cast("Query[SearchField]", query)
7173

7274

7375
def _get_albums(search_results: Iterable[SearchResult]) -> list[Album]:
@@ -418,7 +420,7 @@ def lsinfo(context: MpdContext, uri: str | None = None) -> protocol.Result:
418420
# `protocol.Result``, but this information disappears because of the
419421
# typing of the `protocol.commands.add()`` decorator.
420422
cast(
421-
protocol.ResultList,
423+
"protocol.ResultList",
422424
stored_playlists.listplaylists(context),
423425
)
424426
)

0 commit comments

Comments
 (0)