From 4027add6b3fa1e34b8bf67070dabba15b1e22443 Mon Sep 17 00:00:00 2001 From: Utkarsh Gupta Date: Wed, 9 Oct 2019 00:06:38 +0530 Subject: [PATCH] __init__.pyi: Add missing methods on pkg_resources.VersionConflict (#3318) --- third_party/3/pkg_resources/__init__.pyi | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/third_party/3/pkg_resources/__init__.pyi b/third_party/3/pkg_resources/__init__.pyi index 55914e12b..0b6eb3af0 100644 --- a/third_party/3/pkg_resources/__init__.pyi +++ b/third_party/3/pkg_resources/__init__.pyi @@ -1,6 +1,6 @@ # Stubs for pkg_resources (Python 3.4) -from typing import Any, Callable, Dict, IO, Iterable, Generator, Optional, Sequence, Tuple, List, Union, TypeVar, overload +from typing import Any, Callable, Dict, IO, Iterable, Generator, Optional, Sequence, Tuple, List, Set, Union, TypeVar, overload from abc import ABCMeta import importlib.abc import types @@ -202,7 +202,19 @@ class IMetadataProvider: class ResolutionError(Exception): ... class DistributionNotFound(ResolutionError): ... -class VersionConflict(ResolutionError): ... + +class VersionConflict(ResolutionError): + @property + def dist(self) -> Any: ... + @property + def req(self) -> Any: ... + def report(self) -> str: ... + def with_context(self, required_by: Dict[str, Any]) -> VersionConflict: ... + +class ContextualVersionConflict(VersionConflict): + @property + def required_by(self) -> Set[Any]: ... + class UnknownExtra(ResolutionError): ... class ExtractionError(Exception):