Skip to content

Commit 462d6ca

Browse files
committed
Deprecate install fallback when bdist_wheel fails
1 parent d2eb0ef commit 462d6ca

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

news/8368.removal

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Deprecate legacy setup.py install when building a wheel failed for source
2+
distributions without pyproject.toml

src/pip/_internal/commands/install.py

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
from pip._internal.operations.check import check_install_conflicts
2222
from pip._internal.req import install_given_reqs
2323
from pip._internal.req.req_tracker import get_requirement_tracker
24+
from pip._internal.utils.deprecation import deprecated
2425
from pip._internal.utils.distutils_args import parse_distutils_args
2526
from pip._internal.utils.filesystem import test_writable_dir
2627
from pip._internal.utils.misc import (
@@ -355,9 +356,6 @@ def run(self, options, args):
355356

356357
# If we're using PEP 517, we cannot do a direct install
357358
# so we fail here.
358-
# We don't care about failures building legacy
359-
# requirements, as we'll fall through to a direct
360-
# install for those.
361359
pep517_build_failures = [
362360
r for r in build_failures if r.use_pep517
363361
]
@@ -368,6 +366,26 @@ def run(self, options, args):
368366
", ".join(r.name # type: ignore
369367
for r in pep517_build_failures)))
370368

369+
# For now, we just warn about failures building legacy
370+
# requirements, as we'll fall through to a direct
371+
# install for those.
372+
legacy_build_failures = [
373+
r for r in build_failures if not r.use_pep517
374+
]
375+
if legacy_build_failures:
376+
deprecated(
377+
reason=(
378+
"Could not build wheels for {} which do not use "
379+
"PEP 517. pip will fall back to legacy setup.py "
380+
"install for these.".format(
381+
", ".join(r.name for r in legacy_build_failures)
382+
)
383+
),
384+
replacement="to fix the wheel build issue reported above",
385+
gone_in="21.0",
386+
issue=8368,
387+
)
388+
371389
to_install = resolver.get_installation_order(
372390
requirement_set
373391
)

0 commit comments

Comments
 (0)