From 4fcbe5d136aa6268d5b081a07f78590ad6561a50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Tue, 12 Oct 2021 17:36:40 +0200 Subject: [PATCH] [WIP] hack --- src/pip/_internal/distributions/sdist.py | 7 ++++++- src/pip/_vendor/pep517/in_process/_in_process.py | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/pip/_internal/distributions/sdist.py b/src/pip/_internal/distributions/sdist.py index b4e2892931b..27791ab0aa1 100644 --- a/src/pip/_internal/distributions/sdist.py +++ b/src/pip/_internal/distributions/sdist.py @@ -1,6 +1,8 @@ import logging from typing import Iterable, Set, Tuple +from pip._vendor.pep517.wrappers import HookMissing + from pip._internal.build_env import BuildEnvironment from pip._internal.distributions.base import AbstractDistribution from pip._internal.exceptions import InstallationError @@ -42,7 +44,10 @@ def _setup_isolation(self, finder: PackageFinder) -> None: # This must be done in a second pass, as the pyproject.toml # dependencies must be installed before we can call the backend. if self.req.editable and self.req.permit_editable_wheels: - build_reqs = self._get_build_requires_editable() + try: + build_reqs = self._get_build_requires_editable() + except HookMissing: + build_reqs = self._get_build_requires_wheel() else: build_reqs = self._get_build_requires_wheel() self._install_build_reqs(finder, build_reqs) diff --git a/src/pip/_vendor/pep517/in_process/_in_process.py b/src/pip/_vendor/pep517/in_process/_in_process.py index c7f5f0577f8..1cdca84626e 100644 --- a/src/pip/_vendor/pep517/in_process/_in_process.py +++ b/src/pip/_vendor/pep517/in_process/_in_process.py @@ -126,7 +126,7 @@ def get_requires_for_build_editable(config_settings): try: hook = backend.get_requires_for_build_editable except AttributeError: - return [] + raise HookMissing() else: return hook(config_settings)