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
40 changes: 20 additions & 20 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down
42 changes: 21 additions & 21 deletions src/spotifyaio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]
4 changes: 2 additions & 2 deletions src/spotifyaio/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
4 changes: 3 additions & 1 deletion src/spotifyaio/spotify.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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__)
Expand Down
11 changes: 7 additions & 4 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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


Expand Down
2 changes: 1 addition & 1 deletion tests/ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
]