mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-10 05:51:52 +08:00
Add members marker and unsafe_name to pkg_resources.Requirement (#2693)
For now specify Requirement.marker as Optional[Any] (as suggested by @srittau) as we can't import packaging.markers (pkg_resource does that via runtime magic in pkg_resources.external) Closes #2961
This commit is contained in:
committed by
Sebastian Rittau
parent
6206c5a9d3
commit
f7c9677703
4
third_party/3/pkg_resources/__init__.pyi
vendored
4
third_party/3/pkg_resources/__init__.pyi
vendored
@@ -68,10 +68,14 @@ class Environment:
|
||||
def parse_requirements(strs: Union[str, Iterable[str]]) -> Generator[Requirement, None, None]: ...
|
||||
|
||||
class Requirement:
|
||||
unsafe_name: str
|
||||
project_name: str
|
||||
key: str
|
||||
extras: Tuple[str, ...]
|
||||
specs: List[Tuple[str, str]]
|
||||
# TODO: change this to Optional[packaging.markers.Marker] once we can import
|
||||
# packaging.markers
|
||||
marker: Optional[Any]
|
||||
@staticmethod
|
||||
def parse(s: Union[str, Iterable[str]]) -> Requirement: ...
|
||||
def __contains__(self, item: Union[Distribution, str, Tuple[str, ...]]) -> bool: ...
|
||||
|
||||
Reference in New Issue
Block a user