mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 04:54:47 +08:00
Avoid using new _typeshed protocol in pkg_resources for now (#11909)
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import types
|
||||
import zipimport
|
||||
from _typeshed import Incomplete, StrPath, Unused
|
||||
from _typeshed.importlib import LoaderProtocol
|
||||
from collections.abc import Callable, Generator, Iterable, Iterator, Sequence
|
||||
from io import BytesIO
|
||||
from itertools import chain
|
||||
@@ -13,6 +12,10 @@ from zipfile import ZipInfo
|
||||
|
||||
from ._vendored_packaging import requirements as packaging_requirements, version as packaging_version
|
||||
|
||||
# TODO: Use _typeshed.importlib.LoaderProtocol once mypy has included it in its vendored typeshed
|
||||
class _LoaderProtocol(Protocol):
|
||||
def load_module(self, fullname: str, /) -> types.ModuleType: ...
|
||||
|
||||
_T = TypeVar("_T")
|
||||
_D = TypeVar("_D", bound=Distribution)
|
||||
_NestedStr: TypeAlias = str | Iterable[_NestedStr]
|
||||
@@ -360,7 +363,7 @@ def evaluate_marker(text: str, extra: Incomplete | None = None) -> bool: ...
|
||||
class NullProvider:
|
||||
egg_name: str | None
|
||||
egg_info: str | None
|
||||
loader: LoaderProtocol | None
|
||||
loader: _LoaderProtocol | None
|
||||
module_path: str | None
|
||||
|
||||
def __init__(self, module: _ModuleLike) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user