summaryrefslogtreecommitdiff
path: root/src/pip/_internal/wheel_builder.py
diff options
context:
space:
mode:
authorStéphane Bidoul (ACSONE) <stephane.bidoul@acsone.eu>2019-12-26 18:24:46 +0100
committerStéphane Bidoul (ACSONE) <stephane.bidoul@acsone.eu>2020-01-05 23:52:40 +0100
commit8ca8e9bf61f88ac2b7a45a025b04a5387b3a8d5d (patch)
tree68f17bf4587eca6f849ba42f6bd5ccca58674648 /src/pip/_internal/wheel_builder.py
parent3ae13f7d28f24d63d826197f7b57c67a80ae1be8 (diff)
downloadpip-8ca8e9bf61f88ac2b7a45a025b04a5387b3a8d5d.tar.gz
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.
Diffstat (limited to 'src/pip/_internal/wheel_builder.py')
-rw-r--r--src/pip/_internal/wheel_builder.py9
1 files changed, 8 insertions, 1 deletions
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