From 544c7268e2ac99c7b996f678928952e0a57e7677 Mon Sep 17 00:00:00 2001 From: Avasam Date: Wed, 26 Jun 2024 01:20:49 -0400 Subject: [PATCH] Rename _InstallerTypeT --- pkg_resources/__init__.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/pkg_resources/__init__.py b/pkg_resources/__init__.py index c4ace5aa776..554e1821e9a 100644 --- a/pkg_resources/__init__.py +++ b/pkg_resources/__init__.py @@ -114,7 +114,7 @@ _DistributionT = TypeVar("_DistributionT", bound="Distribution") # Type aliases _NestedStr = Union[str, Iterable[Union[str, Iterable["_NestedStr"]]]] -_InstallerTypeT = Callable[["Requirement"], "_DistributionT"] +_StrictInstallerType = Callable[["Requirement"], "_DistributionT"] _InstallerType = Callable[["Requirement"], Union["Distribution", None]] _PkgReqType = Union[str, "Requirement"] _EPDistType = Union["Distribution", _PkgReqType] @@ -807,7 +807,7 @@ def resolve( self, requirements: Iterable[Requirement], env: Environment | None, - installer: _InstallerTypeT[_DistributionT], + installer: _StrictInstallerType[_DistributionT], replace_conflicting: bool = False, extras: tuple[str, ...] | None = None, ) -> list[_DistributionT]: ... @@ -817,7 +817,7 @@ def resolve( requirements: Iterable[Requirement], env: Environment | None = None, *, - installer: _InstallerTypeT[_DistributionT], + installer: _StrictInstallerType[_DistributionT], replace_conflicting: bool = False, extras: tuple[str, ...] | None = None, ) -> list[_DistributionT]: ... @@ -834,7 +834,7 @@ def resolve( self, requirements: Iterable[Requirement], env: Environment | None = None, - installer: _InstallerType | None | _InstallerTypeT[_DistributionT] = None, + installer: _InstallerType | None | _StrictInstallerType[_DistributionT] = None, replace_conflicting: bool = False, extras: tuple[str, ...] | None = None, ) -> list[Distribution] | list[_DistributionT]: @@ -940,7 +940,7 @@ def find_plugins( self, plugin_env: Environment, full_env: Environment | None, - installer: _InstallerTypeT[_DistributionT], + installer: _StrictInstallerType[_DistributionT], fallback: bool = True, ) -> tuple[list[_DistributionT], dict[Distribution, Exception]]: ... @overload @@ -949,7 +949,7 @@ def find_plugins( plugin_env: Environment, full_env: Environment | None = None, *, - installer: _InstallerTypeT[_DistributionT], + installer: _StrictInstallerType[_DistributionT], fallback: bool = True, ) -> tuple[list[_DistributionT], dict[Distribution, Exception]]: ... @overload @@ -964,7 +964,7 @@ def find_plugins( self, plugin_env: Environment, full_env: Environment | None = None, - installer: _InstallerType | None | _InstallerTypeT[_DistributionT] = None, + installer: _InstallerType | None | _StrictInstallerType[_DistributionT] = None, fallback: bool = True, ) -> tuple[ list[Distribution] | list[_DistributionT], @@ -1211,7 +1211,7 @@ def best_match( self, req: Requirement, working_set: WorkingSet, - installer: _InstallerTypeT[_DistributionT], + installer: _StrictInstallerType[_DistributionT], replace_conflicting: bool = False, ) -> _DistributionT: ... @overload @@ -1226,7 +1226,7 @@ def best_match( self, req: Requirement, working_set: WorkingSet, - installer: _InstallerType | None | _InstallerTypeT[_DistributionT] = None, + installer: _InstallerType | None | _StrictInstallerType[_DistributionT] = None, replace_conflicting: bool = False, ) -> Distribution | None: """Find distribution best matching `req` and usable on `working_set` @@ -1259,7 +1259,7 @@ def best_match( def obtain( self, requirement: Requirement, - installer: _InstallerTypeT[_DistributionT], + installer: _StrictInstallerType[_DistributionT], ) -> _DistributionT: ... @overload def obtain( @@ -1279,7 +1279,7 @@ def obtain( installer: Callable[[Requirement], None] | _InstallerType | None - | _InstallerTypeT[_DistributionT] = None, + | _StrictInstallerType[_DistributionT] = None, ) -> Distribution | None: """Obtain a distribution matching `requirement` (e.g. via download)