From cb7c59bdcdd0d15ca367ed76da27dc6a56dff9eb Mon Sep 17 00:00:00 2001 From: Pradyun Gedam Date: Fri, 30 Sep 2022 18:09:23 +0100 Subject: [PATCH] Use pyproject.toml-based builds in environments without wheel This ensures that we don't fall back to `setup.py install` in such environments to install from source. --- src/pip/_internal/pyproject.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pip/_internal/pyproject.py b/src/pip/_internal/pyproject.py index 1e9119f3e5c..e81ec5e3830 100644 --- a/src/pip/_internal/pyproject.py +++ b/src/pip/_internal/pyproject.py @@ -98,7 +98,9 @@ def load_pyproject_toml( # For more info see: # https://discuss.python.org/t/pip-without-setuptools-could-the-experience-be-improved/11810/9 elif use_pep517 is None: - use_pep517 = has_pyproject or not importlib.util.find_spec("setuptools") + use_pep517 = has_pyproject or not ( + importlib.util.find_spec("setuptools") and importlib.util.find_spec("wheel") + ) # At this point, we know whether we're going to use PEP 517. assert use_pep517 is not None