diff --git a/nvchecker/lib/packaging_version.py b/nvchecker/lib/packaging_version.py index 82b697b..1e5730e 100644 --- a/nvchecker/lib/packaging_version.py +++ b/nvchecker/lib/packaging_version.py @@ -91,11 +91,10 @@ class NegativeInfinityType(object): NegativeInfinity = NegativeInfinityType() + if TYPE_CHECKING: # pragma: no cover from typing import Callable, Iterator, List, Optional, SupportsInt, Tuple, Union - from ._structures import InfinityType, NegativeInfinityType - InfiniteTypes = Union[InfinityType, NegativeInfinityType] PrePostDevType = Union[InfiniteTypes, Tuple[str, int]] SubLocalType = Union[InfiniteTypes, int, str] diff --git a/nvchecker/sortversion.py b/nvchecker/sortversion.py index 4903e99..d8209ed 100644 --- a/nvchecker/sortversion.py +++ b/nvchecker/sortversion.py @@ -1,5 +1,5 @@ # MIT licensed -# Copyright (c) 2013-2017 lilydjwg , et al. +# Copyright (c) 2013-2021 lilydjwg , et al. ''' Sort versions using deprecated pkg_resource / packaging.parse_version or pyalpm.vercmp @@ -7,11 +7,10 @@ Sort versions using deprecated pkg_resource / packaging.parse_version or pyalpm. __all__ = ["sort_version_keys"] -from functools import cmp_to_key - from .lib.packaging_version import parse as parse_version try: import pyalpm + from functools import cmp_to_key vercmp = cmp_to_key(pyalpm.vercmp) vercmp_available = True except ImportError: diff --git a/nvchecker/tools.py b/nvchecker/tools.py index f4de150..60c87d5 100644 --- a/nvchecker/tools.py +++ b/nvchecker/tools.py @@ -107,7 +107,7 @@ def cmp() -> None: if args.sort != "none" and oldver is not None and newver is not None: from .sortversion import sort_version_keys version = sort_version_keys[args.sort] - if version(oldver) > version(newver): + if version(oldver) > version(newver): # type: ignore arrow = f'{c.red}<-{c.normal}' if args.newer: continue