Update deprecated imports

This commit is contained in:
Šarūnas Nejus 2024-11-17 06:40:21 +00:00
parent 7ef1b61070
commit 161b0522bb
No known key found for this signature in database
GPG key ID: DD28F6704DBE3435
15 changed files with 28 additions and 41 deletions

View file

@ -14,7 +14,8 @@
"""Facilities for automatically determining files' correct metadata."""
from typing import Mapping, Sequence, Union
from collections.abc import Mapping, Sequence
from typing import Union
from beets import config, logging
from beets.library import Album, Item

View file

@ -17,8 +17,9 @@
from __future__ import annotations
import re
from collections.abc import Iterable, Iterator
from functools import total_ordering
from typing import Any, Callable, Iterable, Iterator, NamedTuple, TypeVar, cast
from typing import Any, Callable, NamedTuple, TypeVar, cast
from jellyfish import levenshtein_distance
from unidecode import unidecode

View file

@ -20,8 +20,9 @@ from __future__ import annotations
import datetime
import re
from collections.abc import Iterable, Sequence
from enum import IntEnum
from typing import Any, Iterable, NamedTuple, Sequence, TypeVar, Union, cast
from typing import Any, NamedTuple, TypeVar, Union, cast
from munkres import Munkres

View file

@ -19,8 +19,9 @@ from __future__ import annotations
import re
import traceback
from collections import Counter
from collections.abc import Iterator, Sequence
from itertools import product
from typing import Any, Iterator, Sequence, cast
from typing import Any, cast
from urllib.parse import urljoin
import musicbrainzngs

View file

@ -24,21 +24,10 @@ import threading
import time
from abc import ABC
from collections import defaultdict
from collections.abc import Generator, Iterable, Iterator, Mapping, Sequence
from sqlite3 import Connection
from types import TracebackType
from typing import (
Any,
AnyStr,
Callable,
Generator,
Generic,
Iterable,
Iterator,
Mapping,
Sequence,
TypeVar,
cast,
)
from typing import Any, AnyStr, Callable, Generic, TypeVar, cast
from unidecode import unidecode
@ -1131,7 +1120,7 @@ class Database:
conn.close()
@contextlib.contextmanager
def _tx_stack(self) -> Generator[list, None, None]:
def _tx_stack(self) -> Generator[list]:
"""A context manager providing access to the current thread's
transaction stack. The context manager synchronizes access to
the stack map. Transactions should never migrate across threads.

View file

@ -19,21 +19,12 @@ from __future__ import annotations
import re
import unicodedata
from abc import ABC, abstractmethod
from collections.abc import Collection, Iterator, MutableSequence, Sequence
from datetime import datetime, timedelta
from functools import reduce
from operator import mul, or_
from typing import (
TYPE_CHECKING,
Any,
Collection,
Generic,
Iterator,
MutableSequence,
Pattern,
Sequence,
TypeVar,
Union,
)
from re import Pattern
from typing import TYPE_CHECKING, Any, Generic, TypeVar, Union
from beets import util

View file

@ -18,7 +18,7 @@ from __future__ import annotations
import itertools
import re
from typing import Collection, Sequence
from collections.abc import Collection, Sequence
from . import Model, query
from .query import Sort

View file

@ -19,9 +19,10 @@ interface.
import os
import re
from collections import Counter
from collections.abc import Sequence
from itertools import chain
from platform import python_version
from typing import Any, NamedTuple, Sequence
from typing import Any, NamedTuple
import beets
from beets import autotag, config, importer, library, logging, plugins, ui, util

View file

@ -28,20 +28,19 @@ import sys
import tempfile
import traceback
from collections import Counter
from collections.abc import Iterator, Sequence
from contextlib import suppress
from enum import Enum
from importlib import import_module
from multiprocessing.pool import ThreadPool
from pathlib import Path
from re import Pattern
from typing import (
TYPE_CHECKING,
Any,
AnyStr,
Callable,
Iterator,
NamedTuple,
Pattern,
Sequence,
TypeVar,
Union,
)

View file

@ -17,9 +17,10 @@
import os
import re
import sys
from collections.abc import Mapping
from dataclasses import dataclass
from mimetypes import guess_type
from typing import ClassVar, Mapping
from typing import ClassVar
from flask import (
Blueprint,

View file

@ -15,7 +15,7 @@
from __future__ import annotations
from typing import Iterable
from collections.abc import Iterable
import librosa

View file

@ -15,7 +15,7 @@
import fnmatch
import os
import tempfile
from typing import Sequence
from collections.abc import Sequence
import beets
from beets.dbcore.query import InQuery

View file

@ -26,11 +26,12 @@ import subprocess
import sys
import warnings
from abc import ABC, abstractmethod
from collections.abc import Sequence
from dataclasses import dataclass
from logging import Logger
from multiprocessing.pool import ThreadPool
from threading import Event, Thread
from typing import Any, Callable, Sequence, TypeVar, cast
from typing import Any, Callable, TypeVar, cast
from confuse import ConfigView

View file

@ -14,7 +14,7 @@
"""Tests for the 'albumtypes' plugin."""
from typing import Sequence
from collections.abc import Sequence
from beets.autotag.mb import VARIOUS_ARTISTS_ID
from beets.test.helper import PluginTestCase

View file

@ -18,8 +18,9 @@ from __future__ import annotations
import os.path
import sys
import unittest
from collections.abc import Iterator
from contextlib import contextmanager
from typing import Callable, Iterator
from typing import Callable
from beets import plugins
from beets.test.helper import PluginTestCase, capture_log