From: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 22 Mar 2024 13:54:09 +0000 (+0100) Subject: Bump ruff from 0.2.2 to 0.3.3 (#1152) X-Git-Url: https://git.kitaultman.com/?a=commitdiff_plain;h=7c0adfa296bba8650e2d603e39ce75d024db873c;p=music-assistant-server.git Bump ruff from 0.2.2 to 0.3.3 (#1152) * Bump ruff from 0.2.2 to 0.3.3 Bumps [ruff](https://github.com/astral-sh/ruff) from 0.2.2 to 0.3.3. - [Release notes](https://github.com/astral-sh/ruff/releases) - [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md) - [Commits](https://github.com/astral-sh/ruff/compare/v0.2.2...v0.3.3) --- updated-dependencies: - dependency-name: ruff dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * run formatter --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Marcel van der Veldt --- diff --git a/music_assistant/client/connection.py b/music_assistant/client/connection.py index 4dfc9651..f3afb6aa 100644 --- a/music_assistant/client/connection.py +++ b/music_assistant/client/connection.py @@ -1,4 +1,4 @@ -""""Connect o a remote Music Assistant Server using the default Websocket API.""" +"""Connect o a remote Music Assistant Server using the default Websocket API.""" from __future__ import annotations diff --git a/music_assistant/common/models/provider.py b/music_assistant/common/models/provider.py index 404052a3..27c428ea 100644 --- a/music_assistant/common/models/provider.py +++ b/music_assistant/common/models/provider.py @@ -1,4 +1,5 @@ """Models for providers and plugins in the MA ecosystem.""" + from __future__ import annotations import asyncio diff --git a/music_assistant/constants.py b/music_assistant/constants.py index 04ac16a9..680f73b6 100644 --- a/music_assistant/constants.py +++ b/music_assistant/constants.py @@ -75,9 +75,9 @@ DB_TABLE_THUMBS: Final[str] = "thumbnails" DB_TABLE_PROVIDER_MAPPINGS: Final[str] = "provider_mappings" # all other -MASS_LOGO_ONLINE: Final[ - str -] = "https://github.com/home-assistant/brands/raw/master/custom_integrations/mass/icon%402x.png" +MASS_LOGO_ONLINE: Final[str] = ( + "https://github.com/home-assistant/brands/raw/master/custom_integrations/mass/icon%402x.png" +) ENCRYPT_SUFFIX = "_encrypted_" SECURE_STRING_SUBSTITUTE = "this_value_is_encrypted" CONFIGURABLE_CORE_CONTROLLERS = ( diff --git a/music_assistant/server/helpers/logging.py b/music_assistant/server/helpers/logging.py index fee87a63..f48484e0 100644 --- a/music_assistant/server/helpers/logging.py +++ b/music_assistant/server/helpers/logging.py @@ -109,15 +109,13 @@ def log_exception(format_err: Callable[..., Any], *args: Any) -> None: @overload def catch_log_exception( func: Callable[..., Coroutine[Any, Any, Any]], format_err: Callable[..., Any] -) -> Callable[..., Coroutine[Any, Any, None]]: - ... +) -> Callable[..., Coroutine[Any, Any, None]]: ... @overload def catch_log_exception( func: Callable[..., Any], format_err: Callable[..., Any] -) -> Callable[..., None] | Callable[..., Coroutine[Any, Any, None]]: - ... +) -> Callable[..., None] | Callable[..., Coroutine[Any, Any, None]]: ... def catch_log_exception( diff --git a/music_assistant/server/providers/airplay/__init__.py b/music_assistant/server/providers/airplay/__init__.py index 89e9a5bd..8faafab8 100644 --- a/music_assistant/server/providers/airplay/__init__.py +++ b/music_assistant/server/providers/airplay/__init__.py @@ -1,4 +1,5 @@ """Airplay Player provider for Music Assistant.""" + from __future__ import annotations import asyncio diff --git a/music_assistant/server/providers/sonos/helpers.py b/music_assistant/server/providers/sonos/helpers.py index f8be90e7..4f458be3 100644 --- a/music_assistant/server/providers/sonos/helpers.py +++ b/music_assistant/server/providers/sonos/helpers.py @@ -35,15 +35,13 @@ class SonosUpdateError(PlayerCommandFailed): @overload def soco_error( errorcodes: None = ..., -) -> Callable[[_FuncType[_T, _P, _R]], _FuncType[_T, _P, _R]]: - ... +) -> Callable[[_FuncType[_T, _P, _R]], _FuncType[_T, _P, _R]]: ... @overload def soco_error( errorcodes: list[str], -) -> Callable[[_FuncType[_T, _P, _R]], _ReturnFuncType[_T, _P, _R]]: - ... +) -> Callable[[_FuncType[_T, _P, _R]], _ReturnFuncType[_T, _P, _R]]: ... def soco_error( diff --git a/music_assistant/server/providers/spotify/__init__.py b/music_assistant/server/providers/spotify/__init__.py index b99f700f..1d0c5303 100644 --- a/music_assistant/server/providers/spotify/__init__.py +++ b/music_assistant/server/providers/spotify/__init__.py @@ -733,9 +733,12 @@ class SpotifyProvider(MusicProvider): if tokeninfo is None: tokeninfo = await self.login() headers = {"Authorization": f'Bearer {tokeninfo["accessToken"]}'} - async with self._throttler, self.mass.http_session.get( - url, headers=headers, params=kwargs, ssl=True, timeout=120 - ) as response: + async with ( + self._throttler, + self.mass.http_session.get( + url, headers=headers, params=kwargs, ssl=True, timeout=120 + ) as response, + ): # handle spotify rate limiter if response.status == 429: backoff_time = int(response.headers["Retry-After"]) diff --git a/pyproject.toml b/pyproject.toml index 45acec3c..bef03bf8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -53,7 +53,7 @@ test = [ "pytest==8.1.1", "pytest-aiohttp==1.0.5", "pytest-cov==4.1.0", - "ruff==0.2.2", + "ruff==0.3.3", "safety==3.0.1", ]