From d924b16b0db39c316176027260d06c4c8f6f22de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Sat, 18 Jul 2020 13:45:23 +0200 Subject: [PATCH] Give mypy some love after rebase --- src/pip/_internal/commands/install.py | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/src/pip/_internal/commands/install.py b/src/pip/_internal/commands/install.py index 7ed6a05acf0..454c0b70c4c 100644 --- a/src/pip/_internal/commands/install.py +++ b/src/pip/_internal/commands/install.py @@ -356,29 +356,32 @@ def run(self, options, args): # If we're using PEP 517, we cannot do a direct install # so we fail here. - pep517_build_failures = [ - r for r in build_failures if r.use_pep517 - ] - if pep517_build_failures: + pep517_build_failure_names = [ + r.name # type: ignore + for r in build_failures if r.use_pep517 + ] # type: List[str] + if pep517_build_failure_names: raise InstallationError( "Could not build wheels for {} which use" " PEP 517 and cannot be installed directly".format( - ", ".join(r.name # type: ignore - for r in pep517_build_failures))) + ", ".join(pep517_build_failure_names) + ) + ) # For now, we just warn about failures building legacy # requirements, as we'll fall through to a direct # install for those. - legacy_build_failures = [ - r for r in build_failures if not r.use_pep517 - ] - if legacy_build_failures: + legacy_build_failure_names = [ + r.name # type: ignore + for r in build_failures if not r.use_pep517 + ] # type: List[str] + if legacy_build_failure_names: deprecated( reason=( "Could not build wheels for {} which do not use " "PEP 517. pip will fall back to legacy 'setup.py " "install' for these.".format( - ", ".join(r.name for r in legacy_build_failures) + ", ".join(legacy_build_failure_names) ) ), replacement="to fix the wheel build issue reported above",