From f2c5779bb9cbf4a543e0bf9f8c63102e3b9ff119 Mon Sep 17 00:00:00 2001 From: geo-martino Date: Sat, 6 Jan 2024 02:19:48 -0500 Subject: [PATCH] change scopes + more tweaks --- main.py | 5 ++-- src/syncify/config.py | 4 ++-- src/syncify/local/collection.py | 6 ++--- src/syncify/local/library/library.py | 2 +- src/syncify/local/playlist/match.py | 2 +- src/syncify/local/playlist/xautopf.py | 2 +- src/syncify/local/track/__init__.py | 4 ++-- src/syncify/local/track/_base/__init__.py | 1 - src/syncify/local/track/base/__init__.py | 0 .../local/track/{_base => base}/reader.py | 6 ++--- .../local/track/{_base => base}/track.py | 6 ++--- .../local/track/{_base => base}/writer.py | 4 ++-- .../local/track/{fields.py => field.py} | 4 ++-- src/syncify/local/track/flac.py | 6 ++--- src/syncify/local/track/m4a.py | 4 ++-- src/syncify/local/track/mp3.py | 6 ++--- src/syncify/local/track/wma.py | 4 ++-- src/syncify/processors/compare.py | 4 ++-- src/syncify/processors/limit.py | 2 +- src/syncify/processors/match.py | 2 +- src/syncify/processors/sort.py | 2 +- src/syncify/report.py | 2 +- src/syncify/shared/core/base.py | 2 +- src/syncify/shared/core/collection.py | 2 +- src/syncify/shared/core/{enums.py => enum.py} | 0 src/syncify/shared/{fields.py => field.py} | 2 +- src/syncify/shared/remote/api.py | 2 +- src/syncify/shared/remote/base.py | 2 +- .../shared/remote/{enums.py => enum.py} | 2 +- src/syncify/shared/remote/exception.py | 2 +- src/syncify/shared/remote/library.py | 2 +- src/syncify/shared/remote/object.py | 2 +- src/syncify/shared/remote/processors/check.py | 4 ++-- .../shared/remote/processors/search.py | 6 ++--- .../shared/remote/processors/wrangle.py | 4 ++-- src/syncify/spotify/api/item.py | 2 +- src/syncify/spotify/api/misc.py | 2 +- src/syncify/spotify/api/playlist.py | 2 +- src/syncify/spotify/base.py | 2 +- src/syncify/spotify/library.py | 2 +- src/syncify/spotify/object.py | 2 +- src/syncify/spotify/processors/wrangle.py | 2 +- tests/local/library/test_musicbee.py | 1 - .../playlist/test_local_playlist_match.py | 2 +- tests/local/playlist/test_xautopf.py | 2 +- tests/local/track/test_track.py | 4 ++-- tests/local/track/testers.py | 1 - tests/local/track/utils.py | 3 +-- tests/processors/test_compare.py | 4 ++-- tests/processors/test_match.py | 2 +- tests/processors/test_sort.py | 4 ++-- tests/shared/core/enums.py | 2 +- tests/shared/remote/processors/check.py | 2 +- tests/shared/remote/processors/search.py | 4 ++-- tests/shared/remote/utils.py | 2 +- tests/shared/test_fields.py | 6 ++--- tests/spotify/api/mock.py | 23 ++++++++----------- tests/spotify/api/test_spotify_api_item.py | 9 +++++--- tests/spotify/api/test_spotify_api_misc.py | 2 +- .../spotify/api/test_spotify_api_playlist.py | 2 +- tests/spotify/test_spotify_collection.py | 2 +- tests/spotify/test_spotify_library.py | 2 +- tests/spotify/test_spotify_playlist.py | 2 +- tests/spotify/test_spotify_processors.py | 4 ++-- tests/spotify/testers.py | 2 +- tests/spotify/utils.py | 2 +- tests/test_config.py | 4 ++-- tests/test_report.py | 2 +- 68 files changed, 108 insertions(+), 111 deletions(-) delete mode 100644 src/syncify/local/track/_base/__init__.py create mode 100644 src/syncify/local/track/base/__init__.py rename src/syncify/local/track/{_base => base}/reader.py (96%) rename src/syncify/local/track/{_base => base}/track.py (98%) rename src/syncify/local/track/{_base => base}/writer.py (97%) rename src/syncify/local/track/{fields.py => field.py} (91%) rename src/syncify/shared/core/{enums.py => enum.py} (100%) rename src/syncify/shared/{fields.py => field.py} (94%) rename src/syncify/shared/remote/{enums.py => enum.py} (86%) diff --git a/main.py b/main.py index edb452f4..59210dc7 100644 --- a/main.py +++ b/main.py @@ -14,12 +14,12 @@ from syncify import PROGRAM_NAME from syncify.config import Config, ConfigLibraryDifferences, ConfigMissingTags, ConfigRemote, ConfigLocal from syncify.shared.exception import ConfigError -from syncify.local.track.fields import LocalTrackField +from syncify.local.track.field import LocalTrackField from syncify.local.collection import LocalCollection from syncify.local.track import LocalTrack, SyncResultTrack from syncify.processors.base import DynamicProcessor, dynamicprocessormethod from syncify.shared.remote.api import RemoteAPI -from syncify.shared.remote.enums import RemoteObjectType +from syncify.shared.remote.enum import RemoteObjectType from syncify.shared.remote.object import RemoteAlbum from syncify.report import report_playlist_differences, report_missing_tags from syncify.shared.utils import get_user_input, to_collection @@ -760,6 +760,7 @@ def get_parser() -> argparse.ArgumentParser: ## SELECTED FOR DEVELOPMENT +# TODO: fix bug in spotify api test: artist albums have unexpected keys # TODO: expand readme + check all python functions work # TODO: implement XAutoPF full update functionality # TODO: implement merge_playlists functions and, by extension, implement android library sync diff --git a/src/syncify/config.py b/src/syncify/config.py index 10a9de40..0bea64c8 100644 --- a/src/syncify/config.py +++ b/src/syncify/config.py @@ -17,13 +17,13 @@ from syncify import PACKAGE_ROOT, MODULE_ROOT from syncify.shared.core.base import NamedObject -from syncify.shared.core.enums import TagField +from syncify.shared.core.enum import TagField from syncify.shared.core.misc import PrettyPrinter, Filter from syncify.shared.core.object import Library from syncify.shared.api.authorise import APIAuthoriser from syncify.shared.api.request import RequestHandler from syncify.shared.exception import ConfigError, SyncifyError -from syncify.local.track.fields import LocalTrackField +from syncify.local.track.field import LocalTrackField from syncify.local.collection import LocalCollection from syncify.local.exception import InvalidFileType, FileDoesNotExistError from syncify.local.library import MusicBee, LocalLibrary diff --git a/src/syncify/local/collection.py b/src/syncify/local/collection.py index c51ecf45..aa303c71 100644 --- a/src/syncify/local/collection.py +++ b/src/syncify/local/collection.py @@ -11,14 +11,14 @@ from syncify.shared.core.base import Item from syncify.shared.core.collection import ItemCollection -from syncify.shared.core.enums import Fields, TagField, TagFields +from syncify.shared.core.enum import Fields, TagField, TagFields from syncify.shared.core.object import Track, Library, Folder, Album, Artist, Genre from syncify.shared.exception import SyncifyKeyError -from syncify.local.track.fields import LocalTrackField +from syncify.local.track.field import LocalTrackField from syncify.local.base import LocalItem from syncify.local.exception import LocalCollectionError from syncify.local.track import LocalTrack, SyncResultTrack, load_track, TRACK_FILETYPES -from syncify.shared.remote.enums import RemoteIDType +from syncify.shared.remote.enum import RemoteIDType from syncify.shared.remote.processors.wrangle import RemoteDataWrangler from syncify.shared.types import UnitCollection from syncify.shared.utils import get_most_common_values, to_collection, align_and_truncate, get_max_width diff --git a/src/syncify/local/library/library.py b/src/syncify/local/library/library.py index 95caee9b..6336808b 100644 --- a/src/syncify/local/library/library.py +++ b/src/syncify/local/library/library.py @@ -6,7 +6,7 @@ from syncify.shared.core.misc import Result, Filter from syncify.shared.core.object import Playlist, Library from syncify.shared.exception import SyncifyError -from syncify.local.track.fields import LocalTrackField +from syncify.local.track.field import LocalTrackField from syncify.local.collection import LocalCollection, LocalFolder, LocalAlbum, LocalArtist, LocalGenres from syncify.local.exception import LocalCollectionError from syncify.local.playlist import PLAYLIST_FILETYPES, LocalPlaylist, load_playlist diff --git a/src/syncify/local/playlist/match.py b/src/syncify/local/playlist/match.py index 17c1dbe0..e9eaa3bd 100644 --- a/src/syncify/local/playlist/match.py +++ b/src/syncify/local/playlist/match.py @@ -3,7 +3,7 @@ from os.path import exists from typing import Any, Self -from syncify.shared.core.enums import Fields +from syncify.shared.core.enum import Fields from syncify.shared.core.misc import Result from syncify.local.track import LocalTrack from syncify.processors.base import MusicBeeProcessor diff --git a/src/syncify/local/playlist/xautopf.py b/src/syncify/local/playlist/xautopf.py index 317cf6d5..083f6a39 100644 --- a/src/syncify/local/playlist/xautopf.py +++ b/src/syncify/local/playlist/xautopf.py @@ -6,7 +6,7 @@ import xmltodict -from syncify.shared.core.enums import Fields +from syncify.shared.core.enum import Fields from syncify.shared.core.misc import Result from syncify.local.playlist.match import LocalMatcher from syncify.local.playlist.base import LocalPlaylist diff --git a/src/syncify/local/track/__init__.py b/src/syncify/local/track/__init__.py index 8292b912..5d76e83b 100644 --- a/src/syncify/local/track/__init__.py +++ b/src/syncify/local/track/__init__.py @@ -1,5 +1,5 @@ -from ._base.track import LocalTrack -from ._base.writer import SyncResultTrack +from .base.track import LocalTrack +from .base.writer import SyncResultTrack from .flac import FLAC from .m4a import M4A from .mp3 import MP3 diff --git a/src/syncify/local/track/_base/__init__.py b/src/syncify/local/track/_base/__init__.py deleted file mode 100644 index 059f5919..00000000 --- a/src/syncify/local/track/_base/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from .track import LocalTrack diff --git a/src/syncify/local/track/base/__init__.py b/src/syncify/local/track/base/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/src/syncify/local/track/_base/reader.py b/src/syncify/local/track/base/reader.py similarity index 96% rename from src/syncify/local/track/_base/reader.py rename to src/syncify/local/track/base/reader.py index 21438635..a3ac989f 100644 --- a/src/syncify/local/track/_base/reader.py +++ b/src/syncify/local/track/base/reader.py @@ -7,12 +7,12 @@ import mutagen from PIL import Image -from syncify.shared.core.enums import TagMap +from syncify.shared.core.enum import TagMap from syncify.shared.core.object import Track from syncify.shared.exception import SyncifyValueError -from syncify.local.track.fields import LocalTrackField +from syncify.local.track.field import LocalTrackField from syncify.local.base import LocalItem -from syncify.shared.remote.enums import RemoteIDType +from syncify.shared.remote.enum import RemoteIDType from syncify.shared.remote.processors.wrangle import RemoteDataWrangler from syncify.shared.types import UnitIterable from syncify.shared.utils import to_collection diff --git a/src/syncify/local/track/_base/track.py b/src/syncify/local/track/base/track.py similarity index 98% rename from src/syncify/local/track/_base/track.py rename to src/syncify/local/track/base/track.py index dbb03f74..a7fccf0f 100644 --- a/src/syncify/local/track/_base/track.py +++ b/src/syncify/local/track/base/track.py @@ -12,11 +12,11 @@ from syncify.shared.core.base import Item from syncify.shared.core.object import Track from syncify.shared.exception import SyncifyKeyError, SyncifyAttributeError, SyncifyTypeError -from syncify.shared.fields import TrackField +from syncify.shared.field import TrackField from syncify.local.file import File from syncify.local.exception import FileDoesNotExistError -from syncify.local.track._base.reader import TagReader -from syncify.local.track._base.writer import TagWriter +from syncify.local.track.base.reader import TagReader +from syncify.local.track.base.writer import TagWriter from syncify.shared.remote.processors.wrangle import RemoteDataWrangler from syncify.shared.types import UnitIterable diff --git a/src/syncify/local/track/_base/writer.py b/src/syncify/local/track/base/writer.py similarity index 97% rename from src/syncify/local/track/_base/writer.py rename to src/syncify/local/track/base/writer.py index ef71759b..5571ad97 100644 --- a/src/syncify/local/track/_base/writer.py +++ b/src/syncify/local/track/base/writer.py @@ -7,8 +7,8 @@ import mutagen from syncify.shared.core.misc import Result -from syncify.local.track.fields import LocalTrackField as Tags -from syncify.local.track._base.reader import TagReader +from syncify.local.track.field import LocalTrackField as Tags +from syncify.local.track.base.reader import TagReader from syncify.shared.types import UnitIterable from syncify.shared.utils import to_collection diff --git a/src/syncify/local/track/fields.py b/src/syncify/local/track/field.py similarity index 91% rename from src/syncify/local/track/fields.py rename to src/syncify/local/track/field.py index e8b87c4c..837016ce 100644 --- a/src/syncify/local/track/fields.py +++ b/src/syncify/local/track/field.py @@ -1,5 +1,5 @@ -from syncify.shared.core.enums import TagFields -from syncify.shared.fields import TrackFieldMixin +from syncify.shared.core.enum import TagFields +from syncify.shared.field import TrackFieldMixin class LocalTrackField(TrackFieldMixin): diff --git a/src/syncify/local/track/flac.py b/src/syncify/local/track/flac.py index 105887a6..a8f0f8fe 100644 --- a/src/syncify/local/track/flac.py +++ b/src/syncify/local/track/flac.py @@ -7,11 +7,11 @@ import mutagen.id3 from PIL import Image -from syncify.shared.core.enums import TagMap -from syncify.local.track.fields import LocalTrackField +from syncify.shared.core.enum import TagMap +from syncify.local.track.field import LocalTrackField from syncify.local.file import open_image, get_image_bytes from syncify.shared.remote.processors.wrangle import RemoteDataWrangler -from ._base import LocalTrack +from syncify.local.track.base.track import LocalTrack class FLAC(LocalTrack): diff --git a/src/syncify/local/track/m4a.py b/src/syncify/local/track/m4a.py index 34092072..ffa7fe84 100644 --- a/src/syncify/local/track/m4a.py +++ b/src/syncify/local/track/m4a.py @@ -6,11 +6,11 @@ import mutagen.mp4 from PIL import Image -from syncify.shared.core.enums import TagMap +from syncify.shared.core.enum import TagMap from syncify.local.file import open_image, get_image_bytes from syncify.shared.remote.processors.wrangle import RemoteDataWrangler from syncify.shared.utils import to_collection -from ._base import LocalTrack +from syncify.local.track.base.track import LocalTrack class M4A(LocalTrack): diff --git a/src/syncify/local/track/mp3.py b/src/syncify/local/track/mp3.py index d8a14543..51bf027b 100644 --- a/src/syncify/local/track/mp3.py +++ b/src/syncify/local/track/mp3.py @@ -7,11 +7,11 @@ import mutagen.mp3 from PIL import Image -from syncify.shared.core.enums import TagMap -from syncify.local.track.fields import LocalTrackField +from syncify.shared.core.enum import TagMap +from syncify.local.track.field import LocalTrackField from syncify.local.file import open_image, get_image_bytes from syncify.shared.remote.processors.wrangle import RemoteDataWrangler -from ._base import LocalTrack +from syncify.local.track.base.track import LocalTrack class MP3(LocalTrack): diff --git a/src/syncify/local/track/wma.py b/src/syncify/local/track/wma.py index 4834475f..205e29f1 100644 --- a/src/syncify/local/track/wma.py +++ b/src/syncify/local/track/wma.py @@ -8,10 +8,10 @@ import mutagen.id3 from PIL import Image, UnidentifiedImageError -from syncify.shared.core.enums import TagMap +from syncify.shared.core.enum import TagMap from syncify.local.file import open_image, get_image_bytes from syncify.shared.remote.processors.wrangle import RemoteDataWrangler -from ._base import LocalTrack +from syncify.local.track.base.track import LocalTrack class WMA(LocalTrack): diff --git a/src/syncify/processors/compare.py b/src/syncify/processors/compare.py index 5ca5245e..4e403b58 100644 --- a/src/syncify/processors/compare.py +++ b/src/syncify/processors/compare.py @@ -6,8 +6,8 @@ from typing import Any, Self from syncify.shared.core.base import Item -from syncify.shared.core.enums import Field -from syncify.local.track.fields import LocalTrackField +from syncify.shared.core.enum import Field +from syncify.local.track.field import LocalTrackField from syncify.local.exception import FieldError from syncify.processors.base import DynamicProcessor, MusicBeeProcessor, dynamicprocessormethod from syncify.processors.exception import ItemComparerError diff --git a/src/syncify/processors/limit.py b/src/syncify/processors/limit.py index 216114f6..9da3e951 100644 --- a/src/syncify/processors/limit.py +++ b/src/syncify/processors/limit.py @@ -5,7 +5,7 @@ from typing import Any, Self from syncify.shared.core.base import Item -from syncify.shared.core.enums import SyncifyEnum, Fields +from syncify.shared.core.enum import SyncifyEnum, Fields from syncify.shared.core.object import Track from syncify.local.file import File from syncify.processors.base import DynamicProcessor, MusicBeeProcessor, dynamicprocessormethod diff --git a/src/syncify/processors/match.py b/src/syncify/processors/match.py index aae7a56b..c0b90107 100644 --- a/src/syncify/processors/match.py +++ b/src/syncify/processors/match.py @@ -7,7 +7,7 @@ from syncify.shared.core.base import NamedObject from syncify.shared.core.collection import ItemCollection -from syncify.shared.core.enums import TagField, TagFields as Tag, ALL_TAG_FIELDS +from syncify.shared.core.enum import TagField, TagFields as Tag, ALL_TAG_FIELDS from syncify.shared.core.misc import PrettyPrinter from syncify.shared.core.object import Track, Album from syncify.processors.base import ItemProcessor diff --git a/src/syncify/processors/sort.py b/src/syncify/processors/sort.py index 345dc136..7dc9fa8c 100644 --- a/src/syncify/processors/sort.py +++ b/src/syncify/processors/sort.py @@ -5,7 +5,7 @@ from typing import Any, Self from syncify.shared.core.base import Item -from syncify.shared.core.enums import SyncifyEnum, Field, Fields +from syncify.shared.core.enum import SyncifyEnum, Field, Fields from syncify.local.exception import FieldError from syncify.processors.base import MusicBeeProcessor from syncify.shared.types import UnitSequence, UnitIterable diff --git a/src/syncify/report.py b/src/syncify/report.py index b201d722..42a278f8 100644 --- a/src/syncify/report.py +++ b/src/syncify/report.py @@ -3,7 +3,7 @@ from syncify.shared.core.base import Item from syncify.shared.core.collection import ItemCollection -from syncify.shared.core.enums import TagField, Fields, ALL_FIELDS, TagFields +from syncify.shared.core.enum import TagField, Fields, ALL_FIELDS, TagFields from syncify.shared.core.object import Library, Playlist from syncify.local.library import LocalLibrary from syncify.shared.utils import align_and_truncate, get_max_width, to_collection diff --git a/src/syncify/shared/core/base.py b/src/syncify/shared/core/base.py index 5ba71614..8563b064 100644 --- a/src/syncify/shared/core/base.py +++ b/src/syncify/shared/core/base.py @@ -4,7 +4,7 @@ from collections.abc import Hashable from typing import Any -from syncify.shared.core.enums import TagField +from syncify.shared.core.enum import TagField from syncify.shared.core.misc import PrettyPrinter diff --git a/src/syncify/shared/core/collection.py b/src/syncify/shared/core/collection.py index 830e9811..4873dcc4 100644 --- a/src/syncify/shared/core/collection.py +++ b/src/syncify/shared/core/collection.py @@ -5,7 +5,7 @@ from typing import Any, SupportsIndex, Self from syncify.shared.core.base import Item, NamedObjectPrinter -from syncify.shared.core.enums import Field +from syncify.shared.core.enum import Field from syncify.shared.exception import SyncifyTypeError, SyncifyKeyError from syncify.processors.sort import ShuffleMode, ShuffleBy, ItemSorter from syncify.shared.types import UnitSequence diff --git a/src/syncify/shared/core/enums.py b/src/syncify/shared/core/enum.py similarity index 100% rename from src/syncify/shared/core/enums.py rename to src/syncify/shared/core/enum.py diff --git a/src/syncify/shared/fields.py b/src/syncify/shared/field.py similarity index 94% rename from src/syncify/shared/fields.py rename to src/syncify/shared/field.py index 33b176b7..bccadd71 100644 --- a/src/syncify/shared/fields.py +++ b/src/syncify/shared/field.py @@ -1,6 +1,6 @@ from typing import Self -from syncify.shared.core.enums import Field, Fields, TagField, TagFields +from syncify.shared.core.enum import Field, Fields, TagField, TagFields class TrackFieldMixin(TagField): diff --git a/src/syncify/shared/remote/api.py b/src/syncify/shared/remote/api.py index 73c61589..e4b0d12d 100644 --- a/src/syncify/shared/remote/api.py +++ b/src/syncify/shared/remote/api.py @@ -4,7 +4,7 @@ from typing import Any, Self from syncify.shared.api.request import RequestHandler -from syncify.shared.remote.enums import RemoteIDType, RemoteObjectType +from syncify.shared.remote.enum import RemoteIDType, RemoteObjectType from syncify.shared.remote.processors.wrangle import RemoteDataWrangler from syncify.shared.remote.types import APIMethodInputType from syncify.shared.utils import align_and_truncate diff --git a/src/syncify/shared/remote/base.py b/src/syncify/shared/remote/base.py index 61c0977e..51e73721 100644 --- a/src/syncify/shared/remote/base.py +++ b/src/syncify/shared/remote/base.py @@ -4,7 +4,7 @@ from syncify.shared.core.base import Item, NamedObjectPrinter from syncify.shared.api.exception import APIError from syncify.shared.remote.api import RemoteAPI -from syncify.shared.remote._base import Remote +from syncify.shared.remote import Remote class RemoteObject(NamedObjectPrinter, Remote, metaclass=ABCMeta): diff --git a/src/syncify/shared/remote/enums.py b/src/syncify/shared/remote/enum.py similarity index 86% rename from src/syncify/shared/remote/enums.py rename to src/syncify/shared/remote/enum.py index c769535d..1a739608 100644 --- a/src/syncify/shared/remote/enums.py +++ b/src/syncify/shared/remote/enum.py @@ -1,4 +1,4 @@ -from syncify.shared.core.enums import SyncifyEnum +from syncify.shared.core.enum import SyncifyEnum class RemoteIDType(SyncifyEnum): diff --git a/src/syncify/shared/remote/exception.py b/src/syncify/shared/remote/exception.py index 4af5468a..0832f289 100644 --- a/src/syncify/shared/remote/exception.py +++ b/src/syncify/shared/remote/exception.py @@ -1,7 +1,7 @@ from typing import Any from syncify.shared.exception import SyncifyError -from syncify.shared.remote.enums import RemoteIDType, RemoteObjectType +from syncify.shared.remote.enum import RemoteIDType, RemoteObjectType class RemoteError(SyncifyError): diff --git a/src/syncify/shared/remote/library.py b/src/syncify/shared/remote/library.py index e9b3d4d8..77ca953e 100644 --- a/src/syncify/shared/remote/library.py +++ b/src/syncify/shared/remote/library.py @@ -7,7 +7,7 @@ from syncify.shared.core.object import Track, Library, Playlist from syncify.shared.remote.api import RemoteAPI from syncify.shared.remote.config import RemoteObjectClasses -from syncify.shared.remote.enums import RemoteObjectType +from syncify.shared.remote.enum import RemoteObjectType from syncify.shared.remote.object import RemoteTrack, RemoteCollection, RemotePlaylist, SyncResultRemotePlaylist, \ RemoteArtist, RemoteAlbum from syncify.shared.utils import align_and_truncate, get_max_width diff --git a/src/syncify/shared/remote/object.py b/src/syncify/shared/remote/object.py index 644b2ce3..218b3c59 100644 --- a/src/syncify/shared/remote/object.py +++ b/src/syncify/shared/remote/object.py @@ -13,7 +13,7 @@ from syncify.shared.api.exception import APIError from syncify.shared.exception import SyncifyKeyError from syncify.shared.remote.api import RemoteAPI -from syncify.shared.remote.enums import RemoteIDType +from syncify.shared.remote.enum import RemoteIDType from syncify.shared.remote.exception import RemoteIDTypeError, RemoteError from syncify.shared.remote.base import RemoteObject, RemoteItem from syncify.shared.remote.processors.wrangle import RemoteDataWrangler diff --git a/src/syncify/shared/remote/processors/check.py b/src/syncify/shared/remote/processors/check.py index 8ce23553..40c63e1d 100644 --- a/src/syncify/shared/remote/processors/check.py +++ b/src/syncify/shared/remote/processors/check.py @@ -7,13 +7,13 @@ from syncify import PROGRAM_NAME from syncify.shared.core.base import Item from syncify.shared.core.collection import ItemCollection -from syncify.shared.core.enums import Fields +from syncify.shared.core.enum import Fields from syncify.shared.core.misc import Result from syncify.shared.core.object import Track from syncify.processors.match import ItemMatcher from syncify.shared.remote.api import RemoteAPI from syncify.shared.remote.config import RemoteObjectClasses -from syncify.shared.remote.enums import RemoteObjectType, RemoteIDType +from syncify.shared.remote.enum import RemoteObjectType, RemoteIDType from syncify.shared.remote.processors.search import RemoteItemSearcher from syncify.shared.remote.processors.wrangle import RemoteDataWrangler from syncify.shared.utils import get_user_input, get_max_width, align_and_truncate diff --git a/src/syncify/shared/remote/processors/search.py b/src/syncify/shared/remote/processors/search.py index 0d723bdb..a9541304 100644 --- a/src/syncify/shared/remote/processors/search.py +++ b/src/syncify/shared/remote/processors/search.py @@ -6,14 +6,14 @@ from syncify.shared.core.base import Item, NamedObject from syncify.shared.core.collection import ItemCollection -from syncify.shared.core.enums import TagField, TagFields as Tag +from syncify.shared.core.enum import TagField, TagFields as Tag from syncify.shared.core.misc import Result from syncify.shared.core.object import Track from syncify.processors.match import ItemMatcher from syncify.shared.remote.api import RemoteAPI -from syncify.shared.remote._base import Remote +from syncify.shared.remote import Remote from syncify.shared.remote.config import RemoteObjectClasses -from syncify.shared.remote.enums import RemoteObjectType +from syncify.shared.remote.enum import RemoteObjectType from syncify.shared.utils import align_and_truncate, get_max_width from syncify.shared.logger import REPORT diff --git a/src/syncify/shared/remote/processors/wrangle.py b/src/syncify/shared/remote/processors/wrangle.py index 9847166c..9c38111f 100644 --- a/src/syncify/shared/remote/processors/wrangle.py +++ b/src/syncify/shared/remote/processors/wrangle.py @@ -2,8 +2,8 @@ from collections.abc import Mapping from typing import Any -from syncify.shared.remote._base import Remote -from syncify.shared.remote.enums import RemoteIDType, RemoteObjectType +from syncify.shared.remote import Remote +from syncify.shared.remote.enum import RemoteIDType, RemoteObjectType from syncify.shared.remote.exception import RemoteObjectTypeError from syncify.shared.remote.types import APIMethodInputType diff --git a/src/syncify/spotify/api/item.py b/src/syncify/spotify/api/item.py index b15b5159..af5a989a 100644 --- a/src/syncify/spotify/api/item.py +++ b/src/syncify/spotify/api/item.py @@ -7,7 +7,7 @@ from syncify.shared.api.exception import APIError from syncify.shared.remote.api import APIMethodInputType -from syncify.shared.remote.enums import RemoteObjectType, RemoteIDType +from syncify.shared.remote.enum import RemoteObjectType, RemoteIDType from syncify.shared.remote.exception import RemoteObjectTypeError from syncify.spotify.api.base import SpotifyAPIBase from syncify.shared.utils import limit_value diff --git a/src/syncify/spotify/api/misc.py b/src/syncify/spotify/api/misc.py index f95089d5..bdfd2b98 100644 --- a/src/syncify/spotify/api/misc.py +++ b/src/syncify/spotify/api/misc.py @@ -2,7 +2,7 @@ from collections.abc import MutableMapping from typing import Any -from syncify.shared.remote.enums import RemoteIDType, RemoteObjectType +from syncify.shared.remote.enum import RemoteIDType, RemoteObjectType from syncify.spotify.api.base import SpotifyAPIBase from syncify.shared.utils import limit_value diff --git a/src/syncify/spotify/api/playlist.py b/src/syncify/spotify/api/playlist.py index 192f581d..a5fc34a0 100644 --- a/src/syncify/spotify/api/playlist.py +++ b/src/syncify/spotify/api/playlist.py @@ -4,7 +4,7 @@ from typing import Any from syncify import PROGRAM_NAME, PROGRAM_URL -from syncify.shared.remote.enums import RemoteIDType, RemoteObjectType +from syncify.shared.remote.enum import RemoteIDType, RemoteObjectType from syncify.shared.remote.exception import RemoteIDTypeError from syncify.spotify.api.base import SpotifyAPIBase from syncify.shared.utils import limit_value diff --git a/src/syncify/spotify/base.py b/src/syncify/spotify/base.py index 3c4a5bf7..11b3f3f3 100644 --- a/src/syncify/spotify/base.py +++ b/src/syncify/spotify/base.py @@ -2,7 +2,7 @@ from typing import Any from syncify.shared.core.misc import PrettyPrinter -from syncify.shared.remote.enums import RemoteObjectType +from syncify.shared.remote.enum import RemoteObjectType from syncify.shared.remote.exception import RemoteObjectTypeError, RemoteError from syncify.shared.remote.base import RemoteObject, RemoteItem from syncify.spotify import SpotifyRemote diff --git a/src/syncify/spotify/library.py b/src/syncify/spotify/library.py index 240b4ca6..8493fd15 100644 --- a/src/syncify/spotify/library.py +++ b/src/syncify/spotify/library.py @@ -4,7 +4,7 @@ from syncify.shared.core.misc import Filter from syncify.shared.core.object import Playlist, Library from syncify.shared.remote.config import RemoteObjectClasses -from syncify.shared.remote.enums import RemoteObjectType +from syncify.shared.remote.enum import RemoteObjectType from syncify.shared.remote.library import RemoteLibrary from syncify.spotify.api import SpotifyAPI from syncify.spotify.config import SPOTIFY_OBJECT_CLASSES diff --git a/src/syncify/spotify/object.py b/src/syncify/spotify/object.py index 50da0692..ebf21823 100644 --- a/src/syncify/spotify/object.py +++ b/src/syncify/spotify/object.py @@ -6,7 +6,7 @@ from datetime import datetime from typing import Any, Self -from syncify.shared.remote.enums import RemoteObjectType, RemoteIDType +from syncify.shared.remote.enum import RemoteObjectType, RemoteIDType from syncify.shared.remote.object import RemoteCollection, RemoteCollectionLoader, RemoteTrack from syncify.shared.remote.object import RemotePlaylist, RemoteAlbum, RemoteArtist from syncify.spotify.api import SpotifyAPI diff --git a/src/syncify/spotify/processors/wrangle.py b/src/syncify/spotify/processors/wrangle.py index cc84ad05..eee78856 100644 --- a/src/syncify/spotify/processors/wrangle.py +++ b/src/syncify/spotify/processors/wrangle.py @@ -3,7 +3,7 @@ from urllib.parse import urlparse from syncify.shared.exception import SyncifyEnumError -from syncify.shared.remote.enums import RemoteIDType, RemoteObjectType +from syncify.shared.remote.enum import RemoteIDType, RemoteObjectType from syncify.shared.remote.exception import RemoteError, RemoteIDTypeError, RemoteObjectTypeError from syncify.shared.remote.processors.wrangle import RemoteDataWrangler from syncify.shared.remote.api import APIMethodInputType diff --git a/tests/local/library/test_musicbee.py b/tests/local/library/test_musicbee.py index eebbf284..04ea0ad6 100644 --- a/tests/local/library/test_musicbee.py +++ b/tests/local/library/test_musicbee.py @@ -5,7 +5,6 @@ from syncify.local.exception import MusicBeeError, FileDoesNotExistError from syncify.local.library import LocalLibrary, MusicBee -# noinspection PyProtectedMember from syncify.local.library.musicbee import XMLLibraryParser from syncify.local.track import LocalTrack from syncify.shared.remote.processors.wrangle import RemoteDataWrangler diff --git a/tests/local/playlist/test_local_playlist_match.py b/tests/local/playlist/test_local_playlist_match.py index 15ca01ab..f201c952 100644 --- a/tests/local/playlist/test_local_playlist_match.py +++ b/tests/local/playlist/test_local_playlist_match.py @@ -4,7 +4,7 @@ import pytest import xmltodict -from syncify.local.track.fields import LocalTrackField +from syncify.local.track.field import LocalTrackField from syncify.local.playlist import LocalMatcher from syncify.local.track import LocalTrack from syncify.processors.compare import Comparer diff --git a/tests/local/playlist/test_xautopf.py b/tests/local/playlist/test_xautopf.py index 8c0f5278..b4065f8a 100644 --- a/tests/local/playlist/test_xautopf.py +++ b/tests/local/playlist/test_xautopf.py @@ -7,7 +7,7 @@ from tests.local.track.utils import random_track, random_tracks from tests.local.playlist.testers import LocalPlaylistTester -from syncify.local.track.fields import LocalTrackField +from syncify.local.track.field import LocalTrackField from syncify.local.exception import InvalidFileType from syncify.local.playlist import XAutoPF from syncify.local.track import LocalTrack diff --git a/tests/local/track/test_track.py b/tests/local/track/test_track.py index 1071a1fa..e2191c1f 100644 --- a/tests/local/track/test_track.py +++ b/tests/local/track/test_track.py @@ -7,11 +7,11 @@ from syncify.shared.core.base import Item from syncify.shared.core.object import Track from syncify.shared.exception import SyncifyKeyError -from syncify.local.track.fields import LocalTrackField +from syncify.local.track.field import LocalTrackField from syncify.local.file import open_image from syncify.local.exception import InvalidFileType, FileDoesNotExistError from syncify.local.track import LocalTrack, load_track, FLAC, M4A, MP3, WMA -from syncify.shared.remote.enums import RemoteObjectType +from syncify.shared.remote.enum import RemoteObjectType from tests.shared.core.base import ItemTester from tests.local.utils import path_track_all, path_track_img, path_track_resources from tests.spotify.utils import random_uri diff --git a/tests/local/track/testers.py b/tests/local/track/testers.py index 33419eee..f6174564 100644 --- a/tests/local/track/testers.py +++ b/tests/local/track/testers.py @@ -7,7 +7,6 @@ from tests.local.track.utils import random_tracks from syncify.local.collection import LocalCollection from syncify.local.track import LocalTrack -# noinspection PyProtectedMember from syncify.shared.exception import SyncifyKeyError from syncify.spotify.object import SpotifyTrack from tests.shared.core.collection import ItemCollectionTester diff --git a/tests/local/track/utils.py b/tests/local/track/utils.py index 951e920d..a6041d93 100644 --- a/tests/local/track/utils.py +++ b/tests/local/track/utils.py @@ -7,8 +7,7 @@ from dateutil.relativedelta import relativedelta from syncify.local.track import TRACK_CLASSES, LocalTrack -# noinspection PyProtectedMember -from syncify.local.track._base.writer import TagWriter +from syncify.local.track.base.writer import TagWriter from tests.spotify.utils import random_uri from tests.utils import random_str, random_dt, random_genres from tests.local.utils import remote_wrangler, path_track_resources diff --git a/tests/processors/test_compare.py b/tests/processors/test_compare.py index 769c45bf..562de678 100644 --- a/tests/processors/test_compare.py +++ b/tests/processors/test_compare.py @@ -3,8 +3,8 @@ import pytest import xmltodict -from syncify.shared.fields import TrackField -from syncify.local.track.fields import LocalTrackField +from syncify.shared.field import TrackField +from syncify.local.track.field import LocalTrackField from syncify.local.track import MP3, M4A, FLAC from syncify.processors.compare import Comparer from syncify.processors.exception import ItemComparerError, ProcessorLookupError diff --git a/tests/processors/test_match.py b/tests/processors/test_match.py index 2826f837..155b0510 100644 --- a/tests/processors/test_match.py +++ b/tests/processors/test_match.py @@ -1,6 +1,6 @@ import pytest -from syncify.shared.core.enums import TagFields as Tag +from syncify.shared.core.enum import TagFields as Tag from syncify.local.track import LocalTrack from syncify.processors.match import ItemMatcher, CleanTagConfig from tests.shared.core.misc import PrettyPrinterTester diff --git a/tests/processors/test_sort.py b/tests/processors/test_sort.py index fb6425d0..ab8e65fb 100644 --- a/tests/processors/test_sort.py +++ b/tests/processors/test_sort.py @@ -5,8 +5,8 @@ import pytest import xmltodict -from syncify.shared.fields import TrackField -from syncify.local.track.fields import LocalTrackField +from syncify.shared.field import TrackField +from syncify.local.track.field import LocalTrackField from syncify.local.track import LocalTrack from syncify.processors.sort import ItemSorter, ShuffleMode, ShuffleBy from syncify.shared.utils import strip_ignore_words diff --git a/tests/shared/core/enums.py b/tests/shared/core/enums.py index 37c7a768..f318b8a1 100644 --- a/tests/shared/core/enums.py +++ b/tests/shared/core/enums.py @@ -2,7 +2,7 @@ from collections.abc import Container from syncify.shared.core.base import NamedObject -from syncify.shared.core.enums import SyncifyEnum, Fields, TagField, ALL_FIELDS, Field +from syncify.shared.core.enum import SyncifyEnum, Fields, TagField, ALL_FIELDS, Field class EnumTester(ABC): diff --git a/tests/shared/remote/processors/check.py b/tests/shared/remote/processors/check.py index 90b36e27..59e27c7a 100644 --- a/tests/shared/remote/processors/check.py +++ b/tests/shared/remote/processors/check.py @@ -8,7 +8,7 @@ from syncify.shared.core.object import BasicCollection from syncify.local.track import LocalTrack -from syncify.shared.remote.enums import RemoteObjectType +from syncify.shared.remote.enum import RemoteObjectType from syncify.shared.remote.object import RemotePlaylist from syncify.shared.remote.processors.check import RemoteItemChecker from tests.shared.api.utils import path_token diff --git a/tests/shared/remote/processors/search.py b/tests/shared/remote/processors/search.py index 2f09bcc0..0b7759c4 100644 --- a/tests/shared/remote/processors/search.py +++ b/tests/shared/remote/processors/search.py @@ -7,11 +7,11 @@ from syncify.shared.core.base import Item from syncify.shared.core.collection import ItemCollection -from syncify.shared.core.enums import TagFields as Tag +from syncify.shared.core.enum import TagFields as Tag from syncify.shared.core.object import BasicCollection, Album from syncify.local.collection import LocalAlbum from syncify.local.track import LocalTrack -from syncify.shared.remote.enums import RemoteObjectType +from syncify.shared.remote.enum import RemoteObjectType from syncify.shared.remote.processors.search import RemoteItemSearcher, SearchSettings from tests.local.track.utils import random_track, random_tracks from tests.shared.remote.utils import RemoteMock diff --git a/tests/shared/remote/utils.py b/tests/shared/remote/utils.py index 87dd4d9d..6e47e665 100644 --- a/tests/shared/remote/utils.py +++ b/tests/shared/remote/utils.py @@ -8,7 +8,7 @@ # noinspection PyProtectedMember,PyUnresolvedReferences from requests_mock.request import _RequestObjectProxy -from syncify.shared.remote.enums import RemoteIDType, RemoteObjectType +from syncify.shared.remote.enum import RemoteIDType, RemoteObjectType ALL_ID_TYPES = RemoteIDType.all() ALL_ITEM_TYPES = RemoteObjectType.all() diff --git a/tests/shared/test_fields.py b/tests/shared/test_fields.py index 8e819d17..212c8464 100644 --- a/tests/shared/test_fields.py +++ b/tests/shared/test_fields.py @@ -1,9 +1,9 @@ import pytest from syncify.shared.core.object import Track, Playlist, Folder, Artist, Album -from syncify.shared.fields import FolderField, PlaylistField, AlbumField, ArtistField -from syncify.shared.fields import TrackField -from syncify.local.track.fields import LocalTrackField +from syncify.shared.field import FolderField, PlaylistField, AlbumField, ArtistField +from syncify.shared.field import TrackField +from syncify.local.track.field import LocalTrackField from syncify.local.track import LocalTrack from tests.shared.core.enums import FieldTester, TagFieldTester diff --git a/tests/spotify/api/mock.py b/tests/spotify/api/mock.py index c5d6b715..b59d5acc 100644 --- a/tests/spotify/api/mock.py +++ b/tests/spotify/api/mock.py @@ -1,4 +1,3 @@ -import logging import re from collections.abc import Mapping, Callable from copy import deepcopy @@ -14,16 +13,14 @@ # noinspection PyProtectedMember,PyUnresolvedReferences from requests_mock.response import _Context as Context -from syncify.shared.core.enums import SyncifyEnum -from syncify.shared.remote.enums import RemoteObjectType as ObjectType +from syncify.shared.core.enum import SyncifyEnum +from syncify.shared.remote.enum import RemoteObjectType as ObjectType from syncify.spotify import URL_API, URL_EXT, SPOTIFY_NAME from syncify.spotify.api import SpotifyAPI from tests.shared.remote.utils import RemoteMock from tests.spotify.utils import random_id from tests.utils import random_str, random_date_str, random_dt, random_genres -logger = logging.getLogger(__name__) - # noinspection SpellCheckingInspection def idfn(value: Any) -> str | None: @@ -112,11 +109,11 @@ def __init__(self, **kwargs): self.artist_albums = [] for album in self.albums: album = { - k: deepcopy(v) for k, v in album.items() + k: v for k, v in album.items() if k not in {"tracks", "copyrights", "external_ids", "genres", "label", "popularity"} } album["album_group"] = choice(("album", "single", "compilation", "appears_on")) - self.artist_albums.append(album) + self.artist_albums.append(deepcopy(album)) self.setup_specific_conditions() self.setup_valid_references() @@ -172,12 +169,12 @@ def setup_specific_conditions(self): self.albums.append(album) album = { - k: deepcopy(v) for k, v in album.items() + k: v for k, v in album.items() if k not in {"tracks", "copyrights", "external_ids", "genres", "label", "popularity"} } album["album_group"] = choice(("album", "single", "compilation", "appears_on")) albums.append(album) - self.artist_albums.append(album) + self.artist_albums.append(deepcopy(album)) for album in sample(albums, k=15): album["artists"].append(artist) @@ -214,7 +211,7 @@ def setup_valid_references(self): for track in self.tracks: if track["album"]["id"] not in album_ids: track["album"] = { - k: v for k, v in choice(self.albums).items() + k: v for k, v in deepcopy(choice(self.albums)).items() if k not in {"tracks", "copyrights", "external_ids", "genres", "label", "popularity"} } for artist in track["artists"]: @@ -228,7 +225,7 @@ def setup_valid_references(self): def setup_requests_mock(self): """Driver to setup requests_mock responses for all endpoints""" self.setup_search_mock() - self.get(url=f"{URL_API}/me", json=self.user) + self.get(url=f"{URL_API}/me", json=lambda _, __: deepcopy(self.user)) # setup responses as needed for each item type self.setup_items_mock(kind=ObjectType.TRACK, id_map={item["id"]: item for item in self.tracks}) @@ -351,7 +348,7 @@ def response_getter(req: Request, _: Context) -> dict[str, Any]: self.get(url=re.compile(url + r"\?"), json=response_getter) # item batched calls for id_, item in id_map.items(): - self.get(url=f"{url}/{id_}", json=item) # item multi calls + self.get(url=f"{url}/{id_}", json=deepcopy(item)) # item multi calls def setup_items_block_mock(self, url: str, items: list[dict[str, Any]], total: int | None = None) -> None: """Setup requests mock for returning preset responses from the given ``items`` in an 'items block' format.""" @@ -369,8 +366,8 @@ def response_getter(req: Request, _: Context) -> dict[str, Any]: types = req_params["include_groups"][0].split(",") available = [i for i in items if i["album_type"] in types] total = len(available) - it = deepcopy(available[offset: offset + limit]) + it = deepcopy(available[offset: offset + limit]) items_block = self.format_items_block(url=req.url, items=it, offset=offset, limit=limit, total=total) if url.endswith("me/following"): # special case for following artists diff --git a/tests/spotify/api/test_spotify_api_item.py b/tests/spotify/api/test_spotify_api_item.py index 4bb87d24..3d26ff70 100644 --- a/tests/spotify/api/test_spotify_api_item.py +++ b/tests/spotify/api/test_spotify_api_item.py @@ -10,7 +10,7 @@ from requests_mock.request import _RequestObjectProxy as Request from syncify.shared.api.exception import APIError -from syncify.shared.remote.enums import RemoteObjectType as ObjectType, RemoteIDType as IDType, RemoteIDType +from syncify.shared.remote.enum import RemoteObjectType as ObjectType, RemoteIDType as IDType, RemoteIDType from syncify.shared.remote.exception import RemoteObjectTypeError from syncify.spotify.api import SpotifyAPI from tests.shared.remote.utils import ALL_ITEM_TYPES @@ -603,7 +603,7 @@ def test_get_artist_albums_single(self, api: SpotifyAPI, api_mock: SpotifyMock): types = ("album", "single") expected_map = { artist["id"]: [ - album for album in api_mock.artist_albums + deepcopy(album) for album in api_mock.artist_albums if any(art["id"] == artist["id"] for art in album["artists"]) and album["album_type"] in types ] @@ -646,7 +646,10 @@ def test_get_artist_albums_many(self, api: SpotifyAPI, api_mock: SpotifyMock): source = sample(source, api_mock.limit_lower) if len(source) > api_mock.limit_lower else source source_map = {item["id"]: deepcopy(item) for item in source} expected_map = { - id_: [album for album in api_mock.artist_albums if any(art["id"] == id_ for art in album["artists"])] + id_: [ + deepcopy(album) for album in api_mock.artist_albums + if any(art["id"] == id_ for art in album["artists"]) + ] for id_ in source_map } test = random_id_types(id_list=source_map, wrangler=api, kind=ObjectType.ARTIST) diff --git a/tests/spotify/api/test_spotify_api_misc.py b/tests/spotify/api/test_spotify_api_misc.py index cf777e0c..2165994f 100644 --- a/tests/spotify/api/test_spotify_api_misc.py +++ b/tests/spotify/api/test_spotify_api_misc.py @@ -4,7 +4,7 @@ import pytest -from syncify.shared.remote.enums import RemoteObjectType as ObjectType +from syncify.shared.remote.enum import RemoteObjectType as ObjectType from syncify.spotify import URL_EXT from syncify.spotify.api import SpotifyAPI from tests.spotify.api.mock import SpotifyMock, idfn diff --git a/tests/spotify/api/test_spotify_api_playlist.py b/tests/spotify/api/test_spotify_api_playlist.py index 14f064ca..64821035 100644 --- a/tests/spotify/api/test_spotify_api_playlist.py +++ b/tests/spotify/api/test_spotify_api_playlist.py @@ -5,7 +5,7 @@ import pytest from syncify import PROGRAM_NAME -from syncify.shared.remote.enums import RemoteObjectType as ObjectType, RemoteIDType +from syncify.shared.remote.enum import RemoteObjectType as ObjectType, RemoteIDType from syncify.shared.remote.exception import RemoteObjectTypeError, RemoteIDTypeError from syncify.spotify.api import SpotifyAPI from tests.shared.remote.utils import ALL_ITEM_TYPES diff --git a/tests/spotify/test_spotify_collection.py b/tests/spotify/test_spotify_collection.py index 87676072..7cfcb166 100644 --- a/tests/spotify/test_spotify_collection.py +++ b/tests/spotify/test_spotify_collection.py @@ -8,7 +8,7 @@ from tests.spotify.testers import SpotifyCollectionLoaderTester from syncify.shared.api.exception import APIError -from syncify.shared.remote.enums import RemoteObjectType +from syncify.shared.remote.enum import RemoteObjectType from syncify.shared.remote.exception import RemoteObjectTypeError, RemoteError from syncify.spotify import URL_API from syncify.spotify.api import SpotifyAPI diff --git a/tests/spotify/test_spotify_library.py b/tests/spotify/test_spotify_library.py index c2504059..39513860 100644 --- a/tests/spotify/test_spotify_library.py +++ b/tests/spotify/test_spotify_library.py @@ -4,7 +4,7 @@ import pytest -from syncify.shared.remote.enums import RemoteObjectType +from syncify.shared.remote.enum import RemoteObjectType from syncify.spotify.api import SpotifyAPI from syncify.spotify.library import SpotifyLibrary from syncify.spotify.object import SpotifyTrack diff --git a/tests/spotify/test_spotify_playlist.py b/tests/spotify/test_spotify_playlist.py index 12157552..ea833c78 100644 --- a/tests/spotify/test_spotify_playlist.py +++ b/tests/spotify/test_spotify_playlist.py @@ -9,7 +9,7 @@ from tests.spotify.testers import SpotifyCollectionLoaderTester from syncify import PROGRAM_NAME from syncify.shared.api.exception import APIError -from syncify.shared.remote.enums import RemoteObjectType +from syncify.shared.remote.enum import RemoteObjectType from syncify.shared.remote.exception import RemoteObjectTypeError, RemoteError from syncify.spotify.api import SpotifyAPI from syncify.spotify.exception import SpotifyCollectionError diff --git a/tests/spotify/test_spotify_processors.py b/tests/spotify/test_spotify_processors.py index 18acb2aa..0dad0cf2 100644 --- a/tests/spotify/test_spotify_processors.py +++ b/tests/spotify/test_spotify_processors.py @@ -2,12 +2,12 @@ import pytest -from syncify.shared.core.enums import TagFields as Tag +from syncify.shared.core.enum import TagFields as Tag from syncify.shared.exception import SyncifyEnumError from syncify.local.collection import LocalAlbum from syncify.local.track import LocalTrack from syncify.processors.match import CleanTagConfig -from syncify.shared.remote.enums import RemoteIDType as IDType, RemoteObjectType as ObjectType +from syncify.shared.remote.enum import RemoteIDType as IDType, RemoteObjectType as ObjectType from syncify.shared.remote.exception import RemoteError, RemoteIDTypeError, RemoteObjectTypeError from syncify.shared.remote.processors.search import SearchSettings from syncify.spotify import URL_API, URL_EXT diff --git a/tests/spotify/testers.py b/tests/spotify/testers.py index 64b023de..86c95b56 100644 --- a/tests/spotify/testers.py +++ b/tests/spotify/testers.py @@ -6,7 +6,7 @@ # noinspection PyProtectedMember,PyUnresolvedReferences from requests_mock.request import _RequestObjectProxy -from syncify.shared.remote.enums import RemoteObjectType +from syncify.shared.remote.enum import RemoteObjectType from syncify.spotify.api import SpotifyAPI from syncify.spotify.base import SpotifyItem from syncify.spotify.object import SpotifyCollectionLoader, SpotifyTrack diff --git a/tests/spotify/utils.py b/tests/spotify/utils.py index c03d350a..fce2581d 100644 --- a/tests/spotify/utils.py +++ b/tests/spotify/utils.py @@ -5,7 +5,7 @@ # noinspection PyProtectedMember,PyUnresolvedReferences from requests_mock.request import _RequestObjectProxy -from syncify.shared.remote.enums import RemoteIDType, RemoteObjectType +from syncify.shared.remote.enum import RemoteIDType, RemoteObjectType from syncify.shared.remote.processors.wrangle import RemoteDataWrangler from syncify.spotify import URL_API, URL_EXT, SPOTIFY_NAME from syncify.spotify.base import SpotifyObject diff --git a/tests/test_config.py b/tests/test_config.py index 442b1276..7289f09b 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -7,12 +7,12 @@ from requests_cache import CachedSession from syncify import PACKAGE_ROOT, MODULE_ROOT -from syncify.shared.core.enums import TagFields +from syncify.shared.core.enum import TagFields from syncify.config import ConfigLocal, ConfigMusicBee from syncify.config import ConfigRemote, ConfigSpotify from syncify.config import LOCAL_CONFIG, REMOTE_CONFIG, Config, ConfigFilter, ConfigReports from syncify.shared.exception import ConfigError, SyncifyError -from syncify.local.track.fields import LocalTrackField +from syncify.local.track.field import LocalTrackField from syncify.local.exception import FileDoesNotExistError from syncify.shared.remote.processors.wrangle import RemoteDataWrangler from syncify.shared.utils import correct_platform_separators diff --git a/tests/test_report.py b/tests/test_report.py index 3ec8d4aa..c8ffb59f 100644 --- a/tests/test_report.py +++ b/tests/test_report.py @@ -5,7 +5,7 @@ import pytest -from syncify.local.track.fields import LocalTrackField +from syncify.local.track.field import LocalTrackField from syncify.local.library import LocalLibrary from syncify.local.playlist import M3U from syncify.report import report_playlist_differences, report_missing_tags