Skip to content

Commit 047e3f3

Browse files
committed
Deprecate --no-binary implying setup.py install
1 parent bad03ef commit 047e3f3

File tree

2 files changed

+20
-7
lines changed

2 files changed

+20
-7
lines changed

src/pip/_internal/utils/deprecation.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ class LegacyInstallReason:
124124
def __init__(
125125
self,
126126
reason: str,
127-
replacement: Optional[str],
128-
gone_in: Optional[str],
127+
replacement: Optional[str] = None,
128+
gone_in: Optional[str] = None,
129129
feature_flag: Optional[str] = None,
130130
issue: Optional[int] = None,
131131
emit_after_success: bool = False,
@@ -173,3 +173,16 @@ def emit_deprecation(self, name: str) -> None:
173173
issue=8559,
174174
emit_before_install=True,
175175
)
176+
177+
LegacyInstallReasonNoBinaryForcesSetuptoolsInstall = LegacyInstallReason(
178+
reason=(
179+
"{name} is being installed using the legacy "
180+
"'setup.py install' method, because the '--no-binary' option was enabled "
181+
"for it and this currently disables local wheel building for projects that "
182+
"don't have a 'pyproject.toml' file."
183+
),
184+
replacement="to enable the '--use-pep517' option",
185+
gone_in=None,
186+
issue=11451,
187+
emit_before_install=True,
188+
)

src/pip/_internal/wheel_builder.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@
1919
from pip._internal.operations.build.wheel_editable import build_wheel_editable
2020
from pip._internal.operations.build.wheel_legacy import build_wheel_legacy
2121
from pip._internal.req.req_install import InstallRequirement
22-
from pip._internal.utils.deprecation import LegacyInstallReasonMissingWheelPackage
22+
from pip._internal.utils.deprecation import (
23+
LegacyInstallReasonMissingWheelPackage,
24+
LegacyInstallReasonNoBinaryForcesSetuptoolsInstall,
25+
)
2326
from pip._internal.utils.logging import indent_log
2427
from pip._internal.utils.misc import ensure_dir, hash_file, is_wheel_installed
2528
from pip._internal.utils.setuptools_build import make_setuptools_clean_args
@@ -80,10 +83,7 @@ def _should_build(
8083

8184
assert check_bdist_wheel is not None
8285
if not check_bdist_wheel(req):
83-
logger.info(
84-
"Skipping wheel build for %s, due to binaries being disabled for it.",
85-
req.name,
86-
)
86+
req.legacy_install_reason = LegacyInstallReasonNoBinaryForcesSetuptoolsInstall
8787
return False
8888

8989
if not is_wheel_installed():

0 commit comments

Comments
 (0)