Let us walk on the 3-isogeny graph
Loading...
Searching...
No Matches
wheel_editable.py
Go to the documentation of this file.
1import logging
2import os
3from typing import Optional
4
5from pip._vendor.pyproject_hooks import BuildBackendHookCaller, HookMissing
6
7from pip._internal.utils.subprocess import runner_with_spinner_message
8
9logger = logging.getLogger(__name__)
10
11
12def build_wheel_editable(
13 name: str,
14 backend: BuildBackendHookCaller,
15 metadata_directory: str,
16 tempd: str,
17) -> Optional[str]:
18 """Build one InstallRequirement using the PEP 660 build process.
19
20 Returns path to wheel if successfully built. Otherwise, returns None.
21 """
22 assert metadata_directory is not None
23 try:
24 logger.debug("Destination directory: %s", tempd)
25
26 runner = runner_with_spinner_message(
27 f"Building editable for {name} (pyproject.toml)"
28 )
29 with backend.subprocess_runner(runner):
30 try:
31 wheel_name = backend.build_editable(
32 tempd,
33 metadata_directory=metadata_directory,
34 )
35 except HookMissing as e:
37 "Cannot build editable %s because the build "
38 "backend does not have the %s hook",
39 name,
40 e,
41 )
42 return None
43 except Exception:
44 logger.error("Failed building editable for %s", name)
45 return None
46 return os.path.join(tempd, wheel_name)
for i