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:
Dan Čermák
2018-12-18 16:26:56 +01:00
committed by Sebastian Rittau
parent 6206c5a9d3
commit f7c9677703

View File

@@ -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: ...