Skip to content

Commit

Permalink
Deprecate setup.py install fallback when wheel package is absent
Browse files Browse the repository at this point in the history
  • Loading branch information
sbidoul committed Jul 31, 2022
1 parent 56dcb7f commit e67b4fc
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
2 changes: 2 additions & 0 deletions news/8559.removal.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Deprecate installation with 'setup.py install' when the 'wheel' package is absent for
source distributions without 'pyproject.toml'.
12 changes: 12 additions & 0 deletions src/pip/_internal/req/req_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 1 addition & 5 deletions src/pip/_internal/wheel_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e67b4fc

Please sign in to comment.