Skip to content

Commit e67b4fc

Browse files
committed
Deprecate setup.py install fallback when wheel package is absent
1 parent 56dcb7f commit e67b4fc

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

news/8559.removal.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Deprecate installation with 'setup.py install' when the 'wheel' package is absent for
2+
source distributions without 'pyproject.toml'.

src/pip/_internal/req/req_install.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -811,6 +811,18 @@ def install(
811811
install_options = list(install_options) + self.install_options
812812

813813
try:
814+
if self.legacy_install_reason == 8559:
815+
deprecated(
816+
reason=(
817+
f"{self.name} is being installed using the legacy "
818+
f"'setup.py install' method, because it does not have a "
819+
f"'pyproject.toml' and the 'wheel' package "
820+
f"is not installed."
821+
),
822+
replacement="to enable the '--use-pep517' option",
823+
gone_in=None,
824+
issue=8559,
825+
)
814826
success = install_legacy(
815827
install_options=install_options,
816828
global_options=global_options,

src/pip/_internal/wheel_builder.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,7 @@ def _should_build(
8686

8787
if not is_wheel_installed():
8888
# we don't build legacy requirements if wheel is not installed
89-
logger.info(
90-
"Using legacy 'setup.py install' for %s, "
91-
"since package 'wheel' is not installed.",
92-
req.name,
93-
)
89+
req.legacy_install_reason = 8559
9490
return False
9591

9692
return True

0 commit comments

Comments
 (0)