mirror of
https://github.com/lilydjwg/nvchecker
synced 2024-12-25 08:02:21 +00:00
tweaks for mypy
This commit is contained in:
parent
9a42ed9503
commit
ddd99bd59f
@ -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]
|
||||
|
@ -1,5 +1,5 @@
|
||||
# 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
|
||||
@ -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:
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user