mirror of
https://github.com/lilydjwg/nvchecker.git
synced 2025-03-10 06:14:02 +00:00
tweaks for mypy
This commit is contained in:
parent
9a42ed9503
commit
ddd99bd59f
3 changed files with 4 additions and 6 deletions
|
@ -91,11 +91,10 @@ class NegativeInfinityType(object):
|
||||||
|
|
||||||
|
|
||||||
NegativeInfinity = NegativeInfinityType()
|
NegativeInfinity = NegativeInfinityType()
|
||||||
|
|
||||||
if TYPE_CHECKING: # pragma: no cover
|
if TYPE_CHECKING: # pragma: no cover
|
||||||
from typing import Callable, Iterator, List, Optional, SupportsInt, Tuple, Union
|
from typing import Callable, Iterator, List, Optional, SupportsInt, Tuple, Union
|
||||||
|
|
||||||
from ._structures import InfinityType, NegativeInfinityType
|
|
||||||
|
|
||||||
InfiniteTypes = Union[InfinityType, NegativeInfinityType]
|
InfiniteTypes = Union[InfinityType, NegativeInfinityType]
|
||||||
PrePostDevType = Union[InfiniteTypes, Tuple[str, int]]
|
PrePostDevType = Union[InfiniteTypes, Tuple[str, int]]
|
||||||
SubLocalType = Union[InfiniteTypes, int, str]
|
SubLocalType = Union[InfiniteTypes, int, str]
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
# MIT licensed
|
# MIT licensed
|
||||||
# Copyright (c) 2013-2017 lilydjwg <lilydjwg@gmail.com>, et al.
|
# Copyright (c) 2013-2021 lilydjwg <lilydjwg@gmail.com>, et al.
|
||||||
|
|
||||||
'''
|
'''
|
||||||
Sort versions using deprecated pkg_resource / packaging.parse_version or pyalpm.vercmp
|
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"]
|
__all__ = ["sort_version_keys"]
|
||||||
|
|
||||||
from functools import cmp_to_key
|
|
||||||
|
|
||||||
from .lib.packaging_version import parse as parse_version
|
from .lib.packaging_version import parse as parse_version
|
||||||
try:
|
try:
|
||||||
import pyalpm
|
import pyalpm
|
||||||
|
from functools import cmp_to_key
|
||||||
vercmp = cmp_to_key(pyalpm.vercmp)
|
vercmp = cmp_to_key(pyalpm.vercmp)
|
||||||
vercmp_available = True
|
vercmp_available = True
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
|
|
@ -107,7 +107,7 @@ def cmp() -> None:
|
||||||
if args.sort != "none" and oldver is not None and newver is not None:
|
if args.sort != "none" and oldver is not None and newver is not None:
|
||||||
from .sortversion import sort_version_keys
|
from .sortversion import sort_version_keys
|
||||||
version = sort_version_keys[args.sort]
|
version = sort_version_keys[args.sort]
|
||||||
if version(oldver) > version(newver):
|
if version(oldver) > version(newver): # type: ignore
|
||||||
arrow = f'{c.red}<-{c.normal}'
|
arrow = f'{c.red}<-{c.normal}'
|
||||||
if args.newer:
|
if args.newer:
|
||||||
continue
|
continue
|
||||||
|
|
Loading…
Add table
Reference in a new issue