diff --git a/poetry.lock b/poetry.lock index c879aa66..c79f7925 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1857,29 +1857,29 @@ files = [ [[package]] name = "ruff" -version = "0.7.3" +version = "0.8.0" description = "An extremely fast Python linter and code formatter, written in Rust." optional = false python-versions = ">=3.7" files = [ - {file = "ruff-0.7.3-py3-none-linux_armv6l.whl", hash = "sha256:34f2339dc22687ec7e7002792d1f50712bf84a13d5152e75712ac08be565d344"}, - {file = "ruff-0.7.3-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:fb397332a1879b9764a3455a0bb1087bda876c2db8aca3a3cbb67b3dbce8cda0"}, - {file = "ruff-0.7.3-py3-none-macosx_11_0_arm64.whl", hash = "sha256:37d0b619546103274e7f62643d14e1adcbccb242efda4e4bdb9544d7764782e9"}, - {file = "ruff-0.7.3-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5d59f0c3ee4d1a6787614e7135b72e21024875266101142a09a61439cb6e38a5"}, - {file = "ruff-0.7.3-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:44eb93c2499a169d49fafd07bc62ac89b1bc800b197e50ff4633aed212569299"}, - {file = "ruff-0.7.3-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6d0242ce53f3a576c35ee32d907475a8d569944c0407f91d207c8af5be5dae4e"}, - {file = "ruff-0.7.3-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:6b6224af8b5e09772c2ecb8dc9f3f344c1aa48201c7f07e7315367f6dd90ac29"}, - {file = "ruff-0.7.3-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c50f95a82b94421c964fae4c27c0242890a20fe67d203d127e84fbb8013855f5"}, - {file = "ruff-0.7.3-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7f3eff9961b5d2644bcf1616c606e93baa2d6b349e8aa8b035f654df252c8c67"}, - {file = "ruff-0.7.3-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b8963cab06d130c4df2fd52c84e9f10d297826d2e8169ae0c798b6221be1d1d2"}, - {file = "ruff-0.7.3-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:61b46049d6edc0e4317fb14b33bd693245281a3007288b68a3f5b74a22a0746d"}, - {file = "ruff-0.7.3-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:10ebce7696afe4644e8c1a23b3cf8c0f2193a310c18387c06e583ae9ef284de2"}, - {file = "ruff-0.7.3-py3-none-musllinux_1_2_i686.whl", hash = "sha256:3f36d56326b3aef8eeee150b700e519880d1aab92f471eefdef656fd57492aa2"}, - {file = "ruff-0.7.3-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:5d024301109a0007b78d57ab0ba190087b43dce852e552734ebf0b0b85e4fb16"}, - {file = "ruff-0.7.3-py3-none-win32.whl", hash = "sha256:4ba81a5f0c5478aa61674c5a2194de8b02652f17addf8dfc40c8937e6e7d79fc"}, - {file = "ruff-0.7.3-py3-none-win_amd64.whl", hash = "sha256:588a9ff2fecf01025ed065fe28809cd5a53b43505f48b69a1ac7707b1b7e4088"}, - {file = "ruff-0.7.3-py3-none-win_arm64.whl", hash = "sha256:1713e2c5545863cdbfe2cbce21f69ffaf37b813bfd1fb3b90dc9a6f1963f5a8c"}, - {file = "ruff-0.7.3.tar.gz", hash = "sha256:e1d1ba2e40b6e71a61b063354d04be669ab0d39c352461f3d789cac68b54a313"}, + {file = "ruff-0.8.0-py3-none-linux_armv6l.whl", hash = "sha256:fcb1bf2cc6706adae9d79c8d86478677e3bbd4ced796ccad106fd4776d395fea"}, + {file = "ruff-0.8.0-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:295bb4c02d58ff2ef4378a1870c20af30723013f441c9d1637a008baaf928c8b"}, + {file = "ruff-0.8.0-py3-none-macosx_11_0_arm64.whl", hash = "sha256:7b1f1c76b47c18fa92ee78b60d2d20d7e866c55ee603e7d19c1e991fad933a9a"}, + {file = "ruff-0.8.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:eb0d4f250a7711b67ad513fde67e8870109e5ce590a801c3722580fe98c33a99"}, + {file = "ruff-0.8.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:0e55cce9aa93c5d0d4e3937e47b169035c7e91c8655b0974e61bb79cf398d49c"}, + {file = "ruff-0.8.0-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3f4cd64916d8e732ce6b87f3f5296a8942d285bbbc161acee7fe561134af64f9"}, + {file = "ruff-0.8.0-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:c5c1466be2a2ebdf7c5450dd5d980cc87c8ba6976fb82582fea18823da6fa362"}, + {file = "ruff-0.8.0-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2dabfd05b96b7b8f2da00d53c514eea842bff83e41e1cceb08ae1966254a51df"}, + {file = "ruff-0.8.0-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:facebdfe5a5af6b1588a1d26d170635ead6892d0e314477e80256ef4a8470cf3"}, + {file = "ruff-0.8.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:87a8e86bae0dbd749c815211ca11e3a7bd559b9710746c559ed63106d382bd9c"}, + {file = "ruff-0.8.0-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:85e654f0ded7befe2d61eeaf3d3b1e4ef3894469cd664ffa85006c7720f1e4a2"}, + {file = "ruff-0.8.0-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:83a55679c4cb449fa527b8497cadf54f076603cc36779b2170b24f704171ce70"}, + {file = "ruff-0.8.0-py3-none-musllinux_1_2_i686.whl", hash = "sha256:812e2052121634cf13cd6fddf0c1871d0ead1aad40a1a258753c04c18bb71bbd"}, + {file = "ruff-0.8.0-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:780d5d8523c04202184405e60c98d7595bdb498c3c6abba3b6d4cdf2ca2af426"}, + {file = "ruff-0.8.0-py3-none-win32.whl", hash = "sha256:5fdb6efecc3eb60bba5819679466471fd7d13c53487df7248d6e27146e985468"}, + {file = "ruff-0.8.0-py3-none-win_amd64.whl", hash = "sha256:582891c57b96228d146725975fbb942e1f30a0c4ba19722e692ca3eb25cc9b4f"}, + {file = "ruff-0.8.0-py3-none-win_arm64.whl", hash = "sha256:ba93e6294e9a737cd726b74b09a6972e36bb511f9a102f1d9a7e1ce94dd206a6"}, + {file = "ruff-0.8.0.tar.gz", hash = "sha256:a7ccfe6331bf8c8dad715753e157457faf7351c2b69f62f32c165c2dbcbacd44"}, ] [[package]] @@ -2173,4 +2173,4 @@ propcache = ">=0.2.0" [metadata] lock-version = "2.0" python-versions = "^3.11" -content-hash = "fb2e1eec4942bd40789b9ae4e9c10a200264b672bb1523d6f9e26eda8c69ced6" +content-hash = "47b3fbddf3178b097a6f8da6648a29834d7503c8c87f6f8b489e103958ccb361" diff --git a/pyproject.toml b/pyproject.toml index 2584ccc3..20c0faf8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -42,7 +42,7 @@ pylint = "3.3.1" pytest = "8.3.3" pytest-asyncio = "0.24.0" pytest-cov = "6.0.0" -ruff = "0.7.3" +ruff = "0.8.0" safety = "3.2.11" yamllint = "1.35.1" syrupy = "4.8.0" @@ -135,8 +135,6 @@ asyncio_mode = "auto" [tool.ruff.lint] ignore = [ - "ANN101", # Self... explanatory - "ANN102", # cls... just as useless "ANN401", # Opinioated warning on disallowing dynamically typed expressions "COM812", # Conflicts with formatter "D203", # Conflicts with other rules diff --git a/src/spotifyaio/__init__.py b/src/spotifyaio/__init__.py index da42c63a..3d96c087 100644 --- a/src/spotifyaio/__init__.py +++ b/src/spotifyaio/__init__.py @@ -37,35 +37,35 @@ from .spotify import SpotifyClient __all__ = [ + "Album", + "AlbumType", + "Artist", + "BasePlaylist", + "BaseUserProfile", + "Context", + "ContextType", + "CurrentPlaying", "Device", "DeviceType", - "RepeatMode", - "ContextType", - "Context", - "AlbumType", + "Episode", "Image", - "ReleaseDatePrecision", - "SimplifiedArtist", - "SimplifiedAlbum", - "Album", - "Artist", - "Track", - "SimplifiedTrack", - "ItemType", "Item", - "CurrentPlaying", + "ItemType", "PlaybackState", - "PlaylistOwnerType", - "PlaylistOwner", "Playlist", - "BasePlaylist", + "PlaylistOwner", + "PlaylistOwnerType", "ProductType", - "BaseUserProfile", - "UserProfile", - "Episode", + "ReleaseDatePrecision", + "RepeatMode", "Show", - "SpotifyError", - "SpotifyConnectionError", + "SimplifiedAlbum", + "SimplifiedArtist", + "SimplifiedTrack", "SpotifyAuthenticationFailedError", "SpotifyClient", + "SpotifyConnectionError", + "SpotifyError", + "Track", + "UserProfile", ] diff --git a/src/spotifyaio/models.py b/src/spotifyaio/models.py index 62c48995..30d581bd 100644 --- a/src/spotifyaio/models.py +++ b/src/spotifyaio/models.py @@ -3,13 +3,13 @@ from __future__ import annotations from dataclasses import dataclass, field -from datetime import datetime # noqa: TCH003 +from datetime import datetime # noqa: TC003 from enum import IntEnum, StrEnum from typing import Annotated, Any from mashumaro import field_options from mashumaro.mixins.orjson import DataClassORJSONMixin -from mashumaro.types import Discriminator # noqa: TCH002 +from mashumaro.types import Discriminator class DeviceType(StrEnum): diff --git a/src/spotifyaio/spotify.py b/src/spotifyaio/spotify.py index b74c7663..8c9ea189 100644 --- a/src/spotifyaio/spotify.py +++ b/src/spotifyaio/spotify.py @@ -5,7 +5,7 @@ import asyncio from dataclasses import dataclass from importlib import metadata -from typing import TYPE_CHECKING, Any, Awaitable, Callable, Self +from typing import TYPE_CHECKING, Any, Callable, Self from aiohttp import ClientSession from aiohttp.hdrs import METH_DELETE, METH_GET, METH_POST, METH_PUT @@ -56,6 +56,8 @@ from spotifyaio.util import get_identifier if TYPE_CHECKING: + from collections.abc import Awaitable + from spotifyaio import SimplifiedAlbum, SimplifiedTrack, Track VERSION = metadata.version(__package__) diff --git a/tests/conftest.py b/tests/conftest.py index 49a8b5fc..684a41bc 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,6 +1,6 @@ """Asynchronous Python client for Spotify.""" -from typing import AsyncGenerator, Generator +from collections.abc import AsyncGenerator, Generator import aiohttp from aioresponses import aioresponses @@ -21,9 +21,12 @@ def snapshot_assertion(snapshot: SnapshotAssertion) -> SnapshotAssertion: @pytest.fixture(name="spotify_client") async def client() -> AsyncGenerator[SpotifyClient, None]: """Return a Spotify client.""" - async with aiohttp.ClientSession() as session, SpotifyClient( - session=session, - ) as spotify_client: + async with ( + aiohttp.ClientSession() as session, + SpotifyClient( + session=session, + ) as spotify_client, + ): yield spotify_client diff --git a/tests/ruff.toml b/tests/ruff.toml index b9916bc9..05f07311 100644 --- a/tests/ruff.toml +++ b/tests/ruff.toml @@ -10,6 +10,6 @@ lint.extend-ignore = [ "S105", # Detection of passwords... "S106", # Detection of passwords... "SLF001", # Tests will access private/protected members... - "TCH002", # pytest doesn't like this one... + "TC002", # pytest doesn't like this one... "PLR0913", # we're overwriting function that has many arguments ]