From ea3877a769ea556d03f17e78778d62526339f5b2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 4 Jan 2025 15:02:42 +0100 Subject: [PATCH] Chore(deps): Bump ruff from 0.7.4 to 0.8.4 (#1813) * Chore(deps): Bump ruff from 0.7.4 to 0.8.4 Bumps [ruff](https://github.com/astral-sh/ruff) from 0.7.4 to 0.8.4. - [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/0.7.4...0.8.4) --- updated-dependencies: - dependency-name: ruff dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * lint --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Marcel van der Veldt --- music_assistant/controllers/cache.py | 2 +- music_assistant/controllers/metadata.py | 2 +- music_assistant/helpers/playlists.py | 4 +++- pyproject.toml | 8 +++----- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/music_assistant/controllers/cache.py b/music_assistant/controllers/cache.py index 9df242f5..359f9992 100644 --- a/music_assistant/controllers/cache.py +++ b/music_assistant/controllers/cache.py @@ -109,7 +109,7 @@ class CacheController(CoreController): db_row := await self.database.get_row( DB_TABLE_CACHE, {"category": category, "base_key": base_key, "sub_key": key} ) - ) and (not checksum or db_row["checksum"] == checksum and db_row["expires"] >= cur_time): + ) and (not checksum or (db_row["checksum"] == checksum and db_row["expires"] >= cur_time)): try: data = await asyncio.to_thread(json_loads, db_row["data"]) except Exception as exc: diff --git a/music_assistant/controllers/metadata.py b/music_assistant/controllers/metadata.py index 19b4259c..a345ec6c 100644 --- a/music_assistant/controllers/metadata.py +++ b/music_assistant/controllers/metadata.py @@ -410,7 +410,7 @@ class MetaDataController(CoreController): fanart: bool = False, ) -> MediaItemImage | None: """Create collage thumb/fanart image for (in-library) playlist.""" - if len(images) < 8 and fanart or len(images) < 3: + if (len(images) < 8 and fanart) or len(images) < 3: # require at least some images otherwise this does not make a lot of sense return None # limit to 50 images to prevent we're going OOM diff --git a/music_assistant/helpers/playlists.py b/music_assistant/helpers/playlists.py index 9d72381b..f1cbbfd3 100644 --- a/music_assistant/helpers/playlists.py +++ b/music_assistant/helpers/playlists.py @@ -164,7 +164,9 @@ async def fetch_playlist( msg = f"Error while fetching playlist {url}" raise InvalidDataError(msg) from err - if raise_on_hls and "#EXT-X-VERSION:" in playlist_data or "#EXT-X-STREAM-INF:" in playlist_data: + if ( + raise_on_hls and "#EXT-X-VERSION:" in playlist_data + ) or "#EXT-X-STREAM-INF:" in playlist_data: raise IsHLSPlaylist if url.endswith((".m3u", ".m3u8")): diff --git a/pyproject.toml b/pyproject.toml index 90a63d2d..b720c4e6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -52,7 +52,7 @@ test = [ "pytest-cov==5.0.0", "syrupy==4.8.0", "tomli==2.2.1", - "ruff==0.7.4", + "ruff==0.8.4", ] [project.scripts] @@ -129,7 +129,6 @@ asyncio_mode = "auto" ignore = [ "ANN002", # Just annoying, not really useful "ANN003", # Just annoying, not really useful - "ANN101", # Self... explanatory "ANN401", # Opinioated warning on disallowing dynamically typed expressions "D203", # Conflicts with other rules "D213", # Conflicts with other rules @@ -140,8 +139,8 @@ ignore = [ "PLR2004", # Just annoying, not really useful "PD011", # Just annoying, not really useful "S101", # assert is often used to satisfy type checking - "TCH001", # Just annoying, not really useful - "TCH003", # Just annoying, not really useful + "TC001", # Just annoying, not really useful + "TC003", # Just annoying, not really useful "TD002", # Just annoying, not really useful "TD003", # Just annoying, not really useful "TD004", # Just annoying, not really useful @@ -154,7 +153,6 @@ ignore = [ "FBT002", "FBT003", "ANN001", - "ANN102", "ANN201", "ANN202", "TRY002", -- 2.34.1