From 721533195ff1c431bc3d24ae681aa68081b207c9 Mon Sep 17 00:00:00 2001 From: nathom Date: Thu, 13 May 2021 18:55:03 -0700 Subject: [PATCH] Remove packaging dependency --- .mypy.ini | 3 +++ requirements.txt | 1 - streamrip/cli.py | 11 +++-------- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/.mypy.ini b/.mypy.ini index 58be2fc7..00700583 100644 --- a/.mypy.ini +++ b/.mypy.ini @@ -19,3 +19,6 @@ ignore_missing_imports = True [mypy-simple_term_menu.*] ignore_missing_imports = True + +[mypy-setuptools.*] +ignore_missing_imports = True diff --git a/requirements.txt b/requirements.txt index 3f60fadd..55ddf356 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,5 @@ click ruamel.yaml -packaging pathvalidate requests mutagen diff --git a/streamrip/cli.py b/streamrip/cli.py index 7c44b540..c2018d41 100644 --- a/streamrip/cli.py +++ b/streamrip/cli.py @@ -8,11 +8,12 @@ import click import requests +from . import __version__ from .clients import TidalClient from .config import Config from .constants import CACHE_DIR, CONFIG_DIR, CONFIG_PATH, QOBUZ_FEATURED_KEYS from .core import MusicDL -from .utils import init_log + logging.basicConfig(level="WARNING") logger = logging.getLogger("streamrip") @@ -69,15 +70,9 @@ def cli(ctx, **kwargs): return if config.session["check_for_updates"]: - from importlib import metadata - - from packaging import version - r = requests.get("https://pypi.org/pypi/streamrip/json").json() newest = r["info"]["version"] - if version.parse(metadata.version("streamrip")) < version.parse( - newest - ): + if __version__ != newest: click.secho( "A new version of streamrip is available! " "Run `pip3 install streamrip --upgrade` to update.",