From f7c967770329b4c9f156d9bd85760ef120840f5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20=C4=8Cerm=C3=A1k?= <45594031+dcermak@users.noreply.github.com> Date: Tue, 18 Dec 2018 16:26:56 +0100 Subject: [PATCH] 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 --- third_party/3/pkg_resources/__init__.pyi | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/third_party/3/pkg_resources/__init__.pyi b/third_party/3/pkg_resources/__init__.pyi index e7c3d1134..b1703fc52 100644 --- a/third_party/3/pkg_resources/__init__.pyi +++ b/third_party/3/pkg_resources/__init__.pyi @@ -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: ...