mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-02-21 09:08:27 +08:00
Avoid unnecessary forward refs in class definitions (#10124)
This commit is contained in:
@@ -73,10 +73,6 @@ class Environment:
|
||||
def obtain(self, requirement: Requirement, installer: Callable[[Requirement], _T]) -> _T: ...
|
||||
def scan(self, search_path: Sequence[str] | None = None) -> None: ...
|
||||
|
||||
class DistInfoDistribution(Distribution):
|
||||
PKG_INFO: ClassVar[Literal["METADATA"]]
|
||||
EQEQ: ClassVar[Pattern[str]]
|
||||
|
||||
def parse_requirements(strs: str | Iterable[str]) -> Generator[Requirement, None, None]: ...
|
||||
|
||||
class Requirement:
|
||||
@@ -133,50 +129,6 @@ def get_distribution(dist: _D) -> _D: ...
|
||||
@overload
|
||||
def get_distribution(dist: _PkgReqType) -> Distribution: ...
|
||||
|
||||
class Distribution(NullProvider, IResourceProvider, IMetadataProvider):
|
||||
PKG_INFO: ClassVar[str]
|
||||
location: str
|
||||
project_name: str
|
||||
@property
|
||||
def key(self) -> str: ...
|
||||
@property
|
||||
def extras(self) -> list[str]: ...
|
||||
@property
|
||||
def version(self) -> str: ...
|
||||
@property
|
||||
def parsed_version(self) -> tuple[str, ...]: ...
|
||||
py_version: str
|
||||
platform: str | None
|
||||
precedence: int
|
||||
def __init__(
|
||||
self,
|
||||
location: str | None = None,
|
||||
metadata: _MetadataType = None,
|
||||
project_name: str | None = None,
|
||||
version: str | None = None,
|
||||
py_version: str = ...,
|
||||
platform: str | None = None,
|
||||
precedence: int = 3,
|
||||
) -> None: ...
|
||||
@classmethod
|
||||
def from_location(
|
||||
cls, location: str, basename: str, metadata: _MetadataType = None, **kw: str | None | int
|
||||
) -> Distribution: ...
|
||||
@classmethod
|
||||
def from_filename(cls, filename: str, metadata: _MetadataType = None, **kw: str | None | int) -> Distribution: ...
|
||||
def activate(self, path: list[str] | None = None) -> None: ...
|
||||
def as_requirement(self) -> Requirement: ...
|
||||
def requires(self, extras: tuple[str, ...] = ()) -> list[Requirement]: ...
|
||||
def clone(self, **kw: str | int | None) -> Requirement: ...
|
||||
def egg_name(self) -> str: ... # type: ignore[override] # supertype's egg_name is a variable, not a method
|
||||
def __cmp__(self, other: Any) -> bool: ...
|
||||
def get_entry_info(self, group: str, name: str) -> EntryPoint | None: ...
|
||||
@overload
|
||||
def get_entry_map(self) -> dict[str, dict[str, EntryPoint]]: ...
|
||||
@overload
|
||||
def get_entry_map(self, group: str) -> dict[str, EntryPoint]: ...
|
||||
def load_entry_point(self, group: str, name: str) -> Any: ...
|
||||
|
||||
EGG_DIST: int
|
||||
BINARY_DIST: int
|
||||
SOURCE_DIST: int
|
||||
@@ -276,6 +228,54 @@ class NullProvider:
|
||||
def metadata_listdir(self, name: str) -> list[str]: ...
|
||||
def run_script(self, script_name: str, namespace: dict[str, Any]) -> None: ...
|
||||
|
||||
class Distribution(NullProvider, IResourceProvider, IMetadataProvider):
|
||||
PKG_INFO: ClassVar[str]
|
||||
location: str
|
||||
project_name: str
|
||||
@property
|
||||
def key(self) -> str: ...
|
||||
@property
|
||||
def extras(self) -> list[str]: ...
|
||||
@property
|
||||
def version(self) -> str: ...
|
||||
@property
|
||||
def parsed_version(self) -> tuple[str, ...]: ...
|
||||
py_version: str
|
||||
platform: str | None
|
||||
precedence: int
|
||||
def __init__(
|
||||
self,
|
||||
location: str | None = None,
|
||||
metadata: _MetadataType = None,
|
||||
project_name: str | None = None,
|
||||
version: str | None = None,
|
||||
py_version: str = ...,
|
||||
platform: str | None = None,
|
||||
precedence: int = 3,
|
||||
) -> None: ...
|
||||
@classmethod
|
||||
def from_location(
|
||||
cls, location: str, basename: str, metadata: _MetadataType = None, **kw: str | None | int
|
||||
) -> Distribution: ...
|
||||
@classmethod
|
||||
def from_filename(cls, filename: str, metadata: _MetadataType = None, **kw: str | None | int) -> Distribution: ...
|
||||
def activate(self, path: list[str] | None = None) -> None: ...
|
||||
def as_requirement(self) -> Requirement: ...
|
||||
def requires(self, extras: tuple[str, ...] = ()) -> list[Requirement]: ...
|
||||
def clone(self, **kw: str | int | None) -> Requirement: ...
|
||||
def egg_name(self) -> str: ... # type: ignore[override] # supertype's egg_name is a variable, not a method
|
||||
def __cmp__(self, other: Any) -> bool: ...
|
||||
def get_entry_info(self, group: str, name: str) -> EntryPoint | None: ...
|
||||
@overload
|
||||
def get_entry_map(self) -> dict[str, dict[str, EntryPoint]]: ...
|
||||
@overload
|
||||
def get_entry_map(self, group: str) -> dict[str, EntryPoint]: ...
|
||||
def load_entry_point(self, group: str, name: str) -> Any: ...
|
||||
|
||||
class DistInfoDistribution(Distribution):
|
||||
PKG_INFO: ClassVar[Literal["METADATA"]]
|
||||
EQEQ: ClassVar[Pattern[str]]
|
||||
|
||||
class EggProvider(NullProvider):
|
||||
egg_root: str
|
||||
|
||||
|
||||
Reference in New Issue
Block a user