Skip to content

Commit 48986a6

Browse files
committed
Don't fallback to setup.py install when build failed
1 parent fded808 commit 48986a6

File tree

3 files changed

+4
-27
lines changed

3 files changed

+4
-27
lines changed

news/8368.removal.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Remove ``setup.py install`` fallback when building a wheel failed for projects without
2+
``pyproject.toml``.

src/pip/_internal/commands/install.py

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
check_legacy_setup_py_options,
3131
)
3232
from pip._internal.utils.compat import WINDOWS
33-
from pip._internal.utils.deprecation import LegacyInstallReasonFailedBdistWheel
3433
from pip._internal.utils.filesystem import test_writable_dir
3534
from pip._internal.utils.logging import getLogger
3635
from pip._internal.utils.misc import (
@@ -423,26 +422,14 @@ def run(self, options: Values, args: List[str]) -> int:
423422
global_options=global_options,
424423
)
425424

426-
# If we're using PEP 517, we cannot do a legacy setup.py install
427-
# so we fail here.
428-
pep517_build_failure_names: List[str] = [
429-
r.name for r in build_failures if r.use_pep517 # type: ignore
430-
]
431-
if pep517_build_failure_names:
425+
if build_failures:
432426
raise InstallationError(
433427
"Could not build wheels for {}, which is required to "
434428
"install pyproject.toml-based projects".format(
435-
", ".join(pep517_build_failure_names)
429+
", ".join(r.name for r in build_failures) # type: ignore
436430
)
437431
)
438432

439-
# For now, we just warn about failures building legacy
440-
# requirements, as we'll fall through to a setup.py install for
441-
# those.
442-
for r in build_failures:
443-
if not r.use_pep517:
444-
r.legacy_install_reason = LegacyInstallReasonFailedBdistWheel
445-
446433
to_install = resolver.get_installation_order(requirement_set)
447434

448435
# Check for conflicts in the package set we're installing.

src/pip/_internal/utils/deprecation.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -147,15 +147,3 @@ def emit_deprecation(self, name: str) -> None:
147147
feature_flag=self._feature_flag,
148148
issue=self._issue,
149149
)
150-
151-
152-
LegacyInstallReasonFailedBdistWheel = LegacyInstallReason(
153-
reason=(
154-
"{name} was installed using the legacy 'setup.py install' "
155-
"method, because a wheel could not be built for it."
156-
),
157-
replacement="to fix the wheel build issue reported above",
158-
gone_in="23.1",
159-
issue=8368,
160-
emit_after_success=True,
161-
)

0 commit comments

Comments
 (0)