From d10c69f82f61e069746ed0882dfc13dc57e56bf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Sun, 31 May 2020 14:01:29 +0200 Subject: [PATCH] Deprecate install fallback when bdist_wheel fails --- news/8368.removal | 2 ++ src/pip/_internal/commands/install.py | 23 ++++++++++++++++++++--- 2 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 news/8368.removal diff --git a/news/8368.removal b/news/8368.removal new file mode 100644 index 00000000000..646c384d78a --- /dev/null +++ b/news/8368.removal @@ -0,0 +1,2 @@ +Deprecate legacy setup.py install when building a wheel failed for source +distributions without pyproject.toml diff --git a/src/pip/_internal/commands/install.py b/src/pip/_internal/commands/install.py index df21e7ceca2..20df6c25ce7 100644 --- a/src/pip/_internal/commands/install.py +++ b/src/pip/_internal/commands/install.py @@ -359,9 +359,6 @@ def run(self, options, args): # If we're using PEP 517, we cannot do a direct install # so we fail here. - # We don't care about failures building legacy - # requirements, as we'll fall through to a direct - # install for those. pep517_build_failures = [ r for r in build_failures if r.use_pep517 ] @@ -371,6 +368,26 @@ def run(self, options, args): " PEP 517 and cannot be installed directly".format( ", ".join(r.name for r in pep517_build_failures))) + # 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: + 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) + ) + ), + replacement="to fix the wheel build issue reported above", + gone_in="20.3", + issue=8368, + ) + to_install = resolver.get_installation_order( requirement_set )