From e67b4fc97c660004742f7dae539142fa1352a970 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Sun, 31 Jul 2022 17:16:26 +0200 Subject: [PATCH] Deprecate setup.py install fallback when wheel package is absent --- news/8559.removal.rst | 2 ++ src/pip/_internal/req/req_install.py | 12 ++++++++++++ src/pip/_internal/wheel_builder.py | 6 +----- 3 files changed, 15 insertions(+), 5 deletions(-) create mode 100644 news/8559.removal.rst diff --git a/news/8559.removal.rst b/news/8559.removal.rst new file mode 100644 index 00000000000..aa9f814120d --- /dev/null +++ b/news/8559.removal.rst @@ -0,0 +1,2 @@ +Deprecate installation with 'setup.py install' when the 'wheel' package is absent for +source distributions without 'pyproject.toml'. diff --git a/src/pip/_internal/req/req_install.py b/src/pip/_internal/req/req_install.py index a1e376c893a..12fccceba5f 100644 --- a/src/pip/_internal/req/req_install.py +++ b/src/pip/_internal/req/req_install.py @@ -811,6 +811,18 @@ def install( install_options = list(install_options) + self.install_options try: + if self.legacy_install_reason == 8559: + deprecated( + reason=( + f"{self.name} is being installed using the legacy " + f"'setup.py install' method, because it does not have a " + f"'pyproject.toml' and the 'wheel' package " + f"is not installed." + ), + replacement="to enable the '--use-pep517' option", + gone_in=None, + issue=8559, + ) success = install_legacy( install_options=install_options, global_options=global_options, diff --git a/src/pip/_internal/wheel_builder.py b/src/pip/_internal/wheel_builder.py index 77a17ff0f15..e6b4cb947ae 100644 --- a/src/pip/_internal/wheel_builder.py +++ b/src/pip/_internal/wheel_builder.py @@ -86,11 +86,7 @@ def _should_build( if not is_wheel_installed(): # we don't build legacy requirements if wheel is not installed - logger.info( - "Using legacy 'setup.py install' for %s, " - "since package 'wheel' is not installed.", - req.name, - ) + req.legacy_install_reason = 8559 return False return True