From fb6e45a0d4b146d3e5a06ebc42921589e841c5fa Mon Sep 17 00:00:00 2001 From: Robert Honz Date: Sun, 14 Jan 2024 23:27:39 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9B=A0=EF=B8=8F=20Deptry=20warnings=20fix?= =?UTF-8?q?ed.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 4 ++-- poetry.lock | 2 +- pyproject.toml | 3 ++- tidal_dl_ng/api.py | 2 +- tidal_dl_ng/cli.py | 2 +- tidal_dl_ng/download.py | 4 ++-- tidal_dl_ng/gui.py | 2 +- tidal_dl_ng/metadata.py | 3 ++- 8 files changed, 12 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index e413fcd..52e491c 100644 --- a/Makefile +++ b/Makefile @@ -15,8 +15,8 @@ check: ## Run code quality tools. @poetry check --lock @echo "🚀 Linting code: Running pre-commit" @poetry run pre-commit run -a - @echo "🚀 Static type checking: Running mypy" - @poetry run mypy +# @echo "🚀 Static type checking: Running mypy" +# @poetry run mypy @echo "🚀 Checking for obsolete dependencies: Running deptry" @poetry run deptry . diff --git a/poetry.lock b/poetry.lock index f51f5dc..e65b649 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2147,4 +2147,4 @@ gui = ["pyqtdarktheme", "pyside6"] [metadata] lock-version = "2.0" python-versions = ">=3.10,<3.12" -content-hash = "e24689801e7e214b5372e375c1699b409745f1c76cf2dd33a4c1b7adec223da4" +content-hash = "bdddb79a681d97040756bd48a1f391ed85b39b108ebae125c28d348e5fc63cd4" diff --git a/pyproject.toml b/pyproject.toml index 1b56be4..7b5234d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -43,6 +43,7 @@ coloredlogs = "^15.0.1" pyside6 = {version = "^6.6.1", optional = true} pyqtdarktheme = {version = "^2.1.0", optional = true} mpegdash = "^0.3.1" +rich = "^13.7.0" [tool.poetry.extras] gui = ["pyside6", "pyqtdarktheme"] @@ -171,7 +172,7 @@ profile = "black" multi_line_output = 3 indent = 4 color_output = true -known_third_party = ["Crypto", "PySide6", "coloredlogs", "constants", "dataclasses_json", "ffmpeg", "helper", "m3u8", "model", "mpegdash", "mutagen", "pathvalidate", "requests", "rich", "tidalapi", "typer"] +known_third_party = ["Crypto", "PySide6", "coloredlogs", "dataclasses_json", "ffmpeg", "m3u8", "mpegdash", "mutagen", "pathvalidate", "requests", "rich", "tidalapi", "typer"] [tool.mypy] # https://mypy.readthedocs.io/en/latest/config_file.html#using-a-pyproject-toml-file diff --git a/tidal_dl_ng/api.py b/tidal_dl_ng/api.py index 0679c80..5e0dcd5 100644 --- a/tidal_dl_ng/api.py +++ b/tidal_dl_ng/api.py @@ -61,7 +61,7 @@ __ERROR_KEY__ = ( }, ) -from constants import REQUESTS_TIMEOUT_SEC +from tidal_dl_ng.constants import REQUESTS_TIMEOUT_SEC def getNum(): diff --git a/tidal_dl_ng/cli.py b/tidal_dl_ng/cli.py index 5a863e6..bbd66cc 100644 --- a/tidal_dl_ng/cli.py +++ b/tidal_dl_ng/cli.py @@ -3,7 +3,6 @@ from pathlib import Path from typing import Annotated, Optional import typer -from helper.tidal import get_tidal_media_id, get_tidal_media_type from rich.live import Live from rich.panel import Panel from rich.progress import BarColumn, Console, Progress, SpinnerColumn, TextColumn @@ -14,6 +13,7 @@ from tidal_dl_ng.config import Settings, Tidal from tidal_dl_ng.constants import CTX_TIDAL, MediaType from tidal_dl_ng.download import Download from tidal_dl_ng.helper.path import get_format_template, path_file_settings +from tidal_dl_ng.helper.tidal import get_tidal_media_id, get_tidal_media_type from tidal_dl_ng.helper.wrapper import WrapperLogger from tidal_dl_ng.model.cfg import HelpSettings diff --git a/tidal_dl_ng/download.py b/tidal_dl_ng/download.py index 234537f..29cc2d8 100644 --- a/tidal_dl_ng/download.py +++ b/tidal_dl_ng/download.py @@ -12,8 +12,6 @@ from uuid import uuid4 import ffmpeg import m3u8 import requests -from helper.tidal import name_builder_item -from model.tidal import StreamManifest from mpegdash.parser import MPEGDASHParser from requests.exceptions import HTTPError from rich.progress import Progress, TaskID @@ -24,9 +22,11 @@ from tidal_dl_ng.constants import REQUESTS_TIMEOUT_SEC, CoverDimensions, MediaTy from tidal_dl_ng.helper.decryption import decrypt_file, decrypt_security_token from tidal_dl_ng.helper.exceptions import MediaMissing, MediaUnknown, UnknownManifestFormat from tidal_dl_ng.helper.path import check_file_exists, format_path_media, path_file_sanitize +from tidal_dl_ng.helper.tidal import name_builder_item from tidal_dl_ng.helper.wrapper import WrapperLogger from tidal_dl_ng.metadata import Metadata from tidal_dl_ng.model.gui_data import ProgressBars +from tidal_dl_ng.model.tidal import StreamManifest # TODO: Set appropriate client string and use it for video download. diff --git a/tidal_dl_ng/gui.py b/tidal_dl_ng/gui.py index 4c723ca..d0423ec 100644 --- a/tidal_dl_ng/gui.py +++ b/tidal_dl_ng/gui.py @@ -2,7 +2,7 @@ import math import sys from collections.abc import Callable -from helper.path import get_format_template +from tidal_dl_ng.helper.path import get_format_template try: import qdarktheme diff --git a/tidal_dl_ng/metadata.py b/tidal_dl_ng/metadata.py index fa6ff57..b11a9c1 100644 --- a/tidal_dl_ng/metadata.py +++ b/tidal_dl_ng/metadata.py @@ -1,9 +1,10 @@ import mutagen import requests -from constants import REQUESTS_TIMEOUT_SEC from mutagen import flac, id3, mp4 from mutagen.id3 import APIC, TALB, TCOM, TCOP, TDRC, TIT2, TOPE, TPE1, TRCK, TSRC, USLT +from tidal_dl_ng.constants import REQUESTS_TIMEOUT_SEC + class Metadata: path_file: str = None