From 8ca8e9bf61f88ac2b7a45a025b04a5387b3a8d5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul=20=28ACSONE=29?= Date: Thu, 26 Dec 2019 18:24:46 +0100 Subject: Extend should_build scope wrt legacy requirements We don't build legacy requirements when wheel is not installed because we'll fallback to a legacy install in such case. --- src/pip/_internal/wheel_builder.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/pip/_internal/wheel_builder.py') diff --git a/src/pip/_internal/wheel_builder.py b/src/pip/_internal/wheel_builder.py index d80f982fc..423d3b726 100644 --- a/src/pip/_internal/wheel_builder.py +++ b/src/pip/_internal/wheel_builder.py @@ -13,7 +13,7 @@ from pip._internal.models.link import Link from pip._internal.operations.build.wheel import build_wheel_pep517 from pip._internal.operations.build.wheel_legacy import build_wheel_legacy from pip._internal.utils.logging import indent_log -from pip._internal.utils.misc import ensure_dir, hash_file +from pip._internal.utils.misc import ensure_dir, hash_file, is_wheel_installed from pip._internal.utils.setuptools_build import make_setuptools_clean_args from pip._internal.utils.subprocess import call_subprocess from pip._internal.utils.temp_dir import TempDirectory @@ -69,6 +69,13 @@ def should_build( # i.e. pip wheel, not pip install return True + # From this point, this concerns the pip install command only + # (need_wheel=False). + + if not req.use_pep517 and not is_wheel_installed(): + # we don't build legacy requirements if wheel is not installed + return False + if req.editable or not req.source_dir: return False -- cgit v1.2.1