Skip to content

Commit

Permalink
fix python version in worflows
Browse files Browse the repository at this point in the history
  • Loading branch information
geo-martino committed Dec 2, 2024
1 parent 085a621 commit ad4a466
Show file tree
Hide file tree
Showing 21 changed files with 36 additions and 31 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,10 @@ jobs:
include:
- os: windows-latest
name: 🪟 Windows
python-version: [ 3.12, 3.13 ]
- os: macos-latest
name: 🍎 Mac
python-version: [ 3.12, 3.13 ]
steps:
- name: 🛒 Checkout
uses: actions/checkout@v4
Expand Down
4 changes: 3 additions & 1 deletion musify/field.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
from dataclasses import field, dataclass
from typing import Self

from musify.types import UnitIterable, MusifyEnum
from aiorequestful.types import UnitIterable

from musify.types import MusifyEnum


class Field(MusifyEnum):
Expand Down
2 changes: 1 addition & 1 deletion musify/libraries/core/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from pathlib import Path
from typing import Any, SupportsIndex, Self

from aiorequestful.types import UnitSequence
from yarl import URL

from musify.base import MusifyObject, MusifyItem, HasLength
Expand All @@ -17,7 +18,6 @@
from musify.file.base import File
from musify.libraries.remote.core import RemoteResponse
from musify.processors.sort import ShuffleMode, ItemSorter
from musify.types import UnitSequence

type ItemGetterTypes = str | URL | MusifyItem | Path | File | RemoteResponse

Expand Down
3 changes: 2 additions & 1 deletion musify/libraries/local/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
from pathlib import Path
from typing import Any, Self

from aiorequestful.types import UnitCollection, UnitIterable

from musify.field import Fields, TagField, TagFields
from musify.file.exception import UnexpectedPathError
from musify.libraries.core.collection import MusifyCollection
Expand All @@ -22,7 +24,6 @@
from musify.libraries.local.track.field import LocalTrackField
from musify.libraries.remote.core.wrangle import RemoteDataWrangler
from musify.logger import MusifyLogger
from musify.types import UnitCollection, UnitIterable
from musify.utils import get_most_common_values, to_collection, align_string, get_max_width

_max_str = "z" * 50
Expand Down
3 changes: 2 additions & 1 deletion musify/libraries/local/library/library.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
from pathlib import Path
from typing import Any

from aiorequestful.types import UnitCollection, UnitIterable

from musify.base import Result
from musify.exception import MusifyError
from musify.file.path_mapper import PathMapper, PathStemMapper
Expand All @@ -22,7 +24,6 @@
from musify.processors.base import Filter
from musify.processors.filter import FilterDefinedList
from musify.processors.sort import ItemSorter
from musify.types import UnitCollection, UnitIterable
from musify.utils import align_string, get_max_width, to_collection

type RestoreTracksType = Iterable[Mapping[str, Any]] | Mapping[str | Path, Mapping[str, Any]]
Expand Down
2 changes: 1 addition & 1 deletion musify/libraries/local/track/_tags/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
from typing import Any

import mutagen
from aiorequestful.types import UnitIterable

from musify.base import Result
from musify.libraries.core.object import Track
from musify.libraries.local.track._tags.base import TagProcessor
from musify.libraries.local.track.field import LocalTrackField as Tags
from musify.types import UnitIterable
from musify.utils import to_collection


Expand Down
2 changes: 1 addition & 1 deletion musify/libraries/local/track/track.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from typing import Any, Self

import mutagen
from aiorequestful.types import UnitIterable
from yarl import URL

from musify.base import MusifyItem
Expand All @@ -22,7 +23,6 @@
from musify.libraries.local.track._tags import TagReader, TagWriter, SyncResultTrack
from musify.libraries.local.track.field import LocalTrackField as Tags, LocalTrackField
from musify.libraries.remote.core.wrangle import RemoteDataWrangler
from musify.types import UnitIterable
from musify.utils import to_collection


Expand Down
3 changes: 1 addition & 2 deletions musify/libraries/remote/core/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,13 @@
from aiorequestful.cache.session import CachedSession
from aiorequestful.request import RequestHandler
from aiorequestful.response.payload import JSONPayloadHandler
from aiorequestful.types import ImmutableJSON, JSON
from aiorequestful.types import UnitSequence, UnitList, ImmutableJSON, JSON
from yarl import URL

from musify.libraries.remote.core import RemoteResponse
from musify.libraries.remote.core.types import APIInputValueSingle, APIInputValueMulti, RemoteIDType, RemoteObjectType
from musify.libraries.remote.core.wrangle import RemoteDataWrangler
from musify.logger import MusifyLogger
from musify.types import UnitSequence, UnitList
from musify.utils import align_string, to_collection


Expand Down
4 changes: 2 additions & 2 deletions musify/libraries/remote/core/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
from collections.abc import Mapping, MutableMapping
from typing import Any

from aiorequestful.types import URLInput
from aiorequestful.types import UnitMutableSequence, UnitSequence, URLInput
from yarl import URL

from musify.libraries.remote.core import RemoteResponse
from musify.types import UnitMutableSequence, UnitSequence, MusifyEnum
from musify.types import MusifyEnum

type APIInputValueSingle[T: RemoteResponse] = URLInput | Mapping[str, Any] | T
type APIInputValueMulti[T: RemoteResponse] = (
Expand Down
3 changes: 1 addition & 2 deletions musify/libraries/remote/spotify/api/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from aiorequestful.auth.utils import AuthRequest
from aiorequestful.cache.backend.base import ResponseCache, ResponseRepository
from aiorequestful.cache.session import CachedSession
from aiorequestful.types import URLInput
from aiorequestful.types import UnitIterable, URLInput
from yarl import URL

from musify.libraries.remote.core.exception import APIError
Expand All @@ -20,7 +20,6 @@
from musify.libraries.remote.spotify.api.misc import SpotifyAPIMisc
from musify.libraries.remote.spotify.api.playlist import SpotifyAPIPlaylists
from musify.libraries.remote.spotify.wrangle import SpotifyDataWrangler
from musify.types import UnitIterable


class SpotifyAPI(SpotifyAPIMisc, SpotifyAPIItems, SpotifyAPIPlaylists):
Expand Down
3 changes: 2 additions & 1 deletion musify/libraries/remote/spotify/object.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@
from datetime import datetime
from typing import Any, Self

from aiorequestful.types import UnitCollection

from musify.libraries.remote.core import RemoteResponse
from musify.libraries.remote.core.object import RemoteCollectionLoader, RemoteTrack
from musify.libraries.remote.core.object import RemotePlaylist, RemoteAlbum, RemoteArtist
from musify.libraries.remote.core.types import APIInputValueSingle, RemoteIDType, RemoteObjectType
from musify.libraries.remote.spotify.api import SpotifyAPI
from musify.libraries.remote.spotify.base import SpotifyObject, SpotifyItem
from musify.libraries.remote.spotify.exception import SpotifyCollectionError
from musify.types import UnitCollection
from musify.utils import to_collection


Expand Down
4 changes: 2 additions & 2 deletions musify/printer.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
from pathlib import Path
from typing import Any

from aiorequestful.types import ImmutableJSON, JSON, JSON_VALUE
from aiorequestful.types import UnitIterable, ImmutableJSON, JSON, JSON_VALUE
from yarl import URL

from musify.types import UnitIterable, MusifyEnum
from musify.types import MusifyEnum
from musify.utils import to_collection


Expand Down
3 changes: 2 additions & 1 deletion musify/processors/compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@
from operator import mul
from typing import Any

from aiorequestful.types import UnitSequence

from musify.base import MusifyItem
from musify.field import Field
from musify.processors.base import DynamicProcessor, dynamicprocessormethod
from musify.processors.exception import ComparerError
from musify.processors.time import TimeMapper
from musify.types import UnitSequence
from musify.utils import to_collection


Expand Down
3 changes: 2 additions & 1 deletion musify/processors/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@
from urllib.parse import quote
from webbrowser import open as webopen

from aiorequestful.types import UnitIterable

from musify.base import MusifyItem, MusifyObject
from musify.exception import MusifyEnumError
from musify.field import Field, Fields
from musify.libraries.core.collection import MusifyCollection
from musify.processors.base import InputProcessor
from musify.types import UnitIterable
from musify.utils import to_collection


Expand Down
3 changes: 2 additions & 1 deletion musify/processors/filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@
from pathlib import Path
from typing import Any, Self

from aiorequestful.types import UnitCollection

from musify.base import MusifyObject
from musify.processors.base import Filter, FilterComposite
from musify.processors.compare import Comparer
from musify.types import UnitCollection


class FilterDefinedList[T: str | Path | MusifyObject](Filter[T], Collection[T]):
Expand Down
3 changes: 2 additions & 1 deletion musify/processors/match.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@
from dataclasses import dataclass, field
from typing import Any

from aiorequestful.types import UnitIterable

from musify.base import MusifyObject
from musify.field import TagField, TagFields as Tag, ALL_TAG_FIELDS
from musify.libraries.core.collection import MusifyCollection
from musify.logger import MusifyLogger
from musify.printer import PrettyPrinter
from musify.processors.base import Processor
from musify.types import UnitIterable
from musify.utils import limit_value, to_collection


Expand Down
3 changes: 2 additions & 1 deletion musify/processors/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
from dataclasses import dataclass, field
from typing import Any, Self

from aiorequestful.types import UnitIterable

from musify.base import MusifyObject, MusifyItemSettable, Result
from musify.exception import MusifyAttributeError
from musify.field import TagField, TagFields as Tag
Expand All @@ -20,7 +22,6 @@
from musify.logger import REPORT
from musify.processors.base import Processor
from musify.processors.match import ItemMatcher
from musify.types import UnitIterable
from musify.utils import align_string, get_max_width


Expand Down
4 changes: 3 additions & 1 deletion musify/processors/sort.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@
from random import shuffle
from typing import Any

from aiorequestful.types import UnitSequence, UnitIterable, Number

from musify.base import MusifyItem
from musify.field import Field
from musify.processors.base import Processor
from musify.processors.exception import SorterProcessorError
from musify.types import UnitSequence, UnitIterable, Number, MusifyEnum
from musify.types import MusifyEnum
from musify.utils import flatten_nested, strip_ignore_words, to_collection, limit_value


Expand Down
3 changes: 2 additions & 1 deletion musify/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
import logging
from collections.abc import Iterable

from aiorequestful.types import UnitIterable

from musify.base import MusifyItem
from musify.field import TagField, Fields, ALL_FIELDS, TagFields
from musify.libraries.core.collection import MusifyCollection
from musify.libraries.core.object import Library, Playlist
from musify.libraries.local.library import LocalLibrary
from musify.logger import MusifyLogger
from musify.logger import REPORT
from musify.types import UnitIterable
from musify.utils import align_string, get_max_width, to_collection


Expand Down
8 changes: 0 additions & 8 deletions musify/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,6 @@

from musify.exception import MusifyEnumError

type UnitIterable[T] = T | Iterable[T]
type UnitCollection[T] = T | Collection[T]
type UnitSequence[T] = T | Sequence[T]
type UnitMutableSequence[T] = T | MutableSequence[T]
type UnitList[T] = T | list[T]

Number = int | float


class MusifyEnum(IntEnum):
"""Generic class for :py:class:`IntEnum` implementations for the entire package."""
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
from _pytest.fixtures import SubRequest
# noinspection PyProtectedMember
from _pytest.logging import LogCaptureHandler, _remove_ansi_escape_sequences
from aiorequestful.types import UnitCollection

from musify import MODULE_ROOT
from musify.libraries.remote.core.types import RemoteObjectType
from musify.libraries.remote.spotify.api import SpotifyAPI
from musify.libraries.remote.spotify.wrangle import SpotifyDataWrangler
from musify.logger import MusifyLogger
from musify.types import UnitCollection
from musify.utils import to_collection
from tests.libraries.remote.core.utils import ALL_ITEM_TYPES
from tests.libraries.remote.spotify.api.mock import SpotifyMock
Expand Down

0 comments on commit ad4a466

Please sign in to comment.