|
21 | 21 | from pip._internal.operations.check import check_install_conflicts
|
22 | 22 | from pip._internal.req import install_given_reqs
|
23 | 23 | from pip._internal.req.req_tracker import get_requirement_tracker
|
| 24 | +from pip._internal.utils.deprecation import deprecated |
24 | 25 | from pip._internal.utils.distutils_args import parse_distutils_args
|
25 | 26 | from pip._internal.utils.filesystem import test_writable_dir
|
26 | 27 | from pip._internal.utils.misc import (
|
@@ -355,18 +356,38 @@ def run(self, options, args):
|
355 | 356 |
|
356 | 357 | # If we're using PEP 517, we cannot do a direct install
|
357 | 358 | # 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. |
361 |
| - pep517_build_failures = [ |
362 |
| - r for r in build_failures if r.use_pep517 |
363 |
| - ] |
364 |
| - if pep517_build_failures: |
| 359 | + pep517_build_failure_names = [ |
| 360 | + r.name # type: ignore |
| 361 | + for r in build_failures if r.use_pep517 |
| 362 | + ] # type: List[str] |
| 363 | + if pep517_build_failure_names: |
365 | 364 | raise InstallationError(
|
366 | 365 | "Could not build wheels for {} which use"
|
367 | 366 | " PEP 517 and cannot be installed directly".format(
|
368 |
| - ", ".join(r.name # type: ignore |
369 |
| - for r in pep517_build_failures))) |
| 367 | + ", ".join(pep517_build_failure_names) |
| 368 | + ) |
| 369 | + ) |
| 370 | + |
| 371 | + # For now, we just warn about failures building legacy |
| 372 | + # requirements, as we'll fall through to a direct |
| 373 | + # install for those. |
| 374 | + legacy_build_failure_names = [ |
| 375 | + r.name # type: ignore |
| 376 | + for r in build_failures if not r.use_pep517 |
| 377 | + ] # type: List[str] |
| 378 | + if legacy_build_failure_names: |
| 379 | + deprecated( |
| 380 | + reason=( |
| 381 | + "Could not build wheels for {} which do not use " |
| 382 | + "PEP 517. pip will fall back to legacy 'setup.py " |
| 383 | + "install' for these.".format( |
| 384 | + ", ".join(legacy_build_failure_names) |
| 385 | + ) |
| 386 | + ), |
| 387 | + replacement="to fix the wheel build issue reported above", |
| 388 | + gone_in="21.0", |
| 389 | + issue=8368, |
| 390 | + ) |
370 | 391 |
|
371 | 392 | to_install = resolver.get_installation_order(
|
372 | 393 | requirement_set
|
|
0 commit comments