mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 05:24:52 +08:00
Fix type annotation in pkg_resources.parse_version (#5098)
Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
This commit is contained in:
@@ -4,6 +4,9 @@ import zipimport
|
||||
from abc import ABCMeta
|
||||
from typing import IO, Any, Callable, Dict, Generator, Iterable, List, Optional, Sequence, Set, Tuple, TypeVar, Union, overload
|
||||
|
||||
LegacyVersion = Any # from packaging.version
|
||||
Version = Any # from packaging.version
|
||||
|
||||
_T = TypeVar("_T")
|
||||
_NestedStr = Union[str, Iterable[Union[str, Iterable[Any]]]]
|
||||
_InstallerType = Callable[[Requirement], Optional[Distribution]]
|
||||
@@ -254,7 +257,7 @@ empty_provider: EmptyProvider
|
||||
class FileMetadata(EmptyProvider, IResourceProvider):
|
||||
def __init__(self, path_to_pkg_info: str) -> None: ...
|
||||
|
||||
def parse_version(v: str) -> Tuple[str, ...]: ...
|
||||
def parse_version(v: str) -> Union[Version, LegacyVersion]: ...
|
||||
def yield_lines(strs: _NestedStr) -> Generator[str, None, None]: ...
|
||||
def split_sections(strs: _NestedStr) -> Generator[Tuple[Optional[str], str], None, None]: ...
|
||||
def safe_name(name: str) -> str: ...
|
||||
|
||||
Reference in New Issue
Block a user