|
10 | 10 | import shutil
|
11 | 11 |
|
12 | 12 | from pip._internal.models.link import Link
|
| 13 | +from pip._internal.operations.build.wheel import build_wheel_pep517 |
13 | 14 | from pip._internal.operations.build.wheel_legacy import build_wheel_legacy
|
14 | 15 | from pip._internal.utils.logging import indent_log
|
15 | 16 | from pip._internal.utils.marker_files import has_delete_marker_file
|
16 | 17 | from pip._internal.utils.misc import ensure_dir, hash_file
|
17 | 18 | from pip._internal.utils.setuptools_build import make_setuptools_clean_args
|
18 |
| -from pip._internal.utils.subprocess import ( |
19 |
| - call_subprocess, |
20 |
| - runner_with_spinner_message, |
21 |
| -) |
| 19 | +from pip._internal.utils.subprocess import call_subprocess |
22 | 20 | from pip._internal.utils.temp_dir import TempDirectory
|
23 | 21 | from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
24 | 22 | from pip._internal.utils.unpacking import unpack_file
|
|
35 | 33 | RequirementPreparer
|
36 | 34 | )
|
37 | 35 | from pip._internal.req.req_install import InstallRequirement
|
38 |
| - from pip._vendor.pep517.wrappers import Pep517HookCaller |
39 | 36 |
|
40 | 37 | BinaryAllowedPredicate = Callable[[InstallRequirement], bool]
|
41 | 38 | BuildResult = Tuple[List[InstallRequirement], List[InstallRequirement]]
|
@@ -127,41 +124,6 @@ def should_cache(
|
127 | 124 | return False
|
128 | 125 |
|
129 | 126 |
|
130 |
| -def _build_wheel_pep517( |
131 |
| - name, # type: str |
132 |
| - backend, # type: Pep517HookCaller |
133 |
| - metadata_directory, # type: str |
134 |
| - build_options, # type: List[str] |
135 |
| - tempd, # type: str |
136 |
| -): |
137 |
| - # type: (...) -> Optional[str] |
138 |
| - """Build one InstallRequirement using the PEP 517 build process. |
139 |
| -
|
140 |
| - Returns path to wheel if successfully built. Otherwise, returns None. |
141 |
| - """ |
142 |
| - assert metadata_directory is not None |
143 |
| - if build_options: |
144 |
| - # PEP 517 does not support --build-options |
145 |
| - logger.error('Cannot build wheel for %s using PEP 517 when ' |
146 |
| - '--build-option is present' % (name,)) |
147 |
| - return None |
148 |
| - try: |
149 |
| - logger.debug('Destination directory: %s', tempd) |
150 |
| - |
151 |
| - runner = runner_with_spinner_message( |
152 |
| - 'Building wheel for {} (PEP 517)'.format(name) |
153 |
| - ) |
154 |
| - with backend.subprocess_runner(runner): |
155 |
| - wheel_name = backend.build_wheel( |
156 |
| - tempd, |
157 |
| - metadata_directory=metadata_directory, |
158 |
| - ) |
159 |
| - except Exception: |
160 |
| - logger.error('Failed building wheel for %s', name) |
161 |
| - return None |
162 |
| - return os.path.join(tempd, wheel_name) |
163 |
| - |
164 |
| - |
165 | 127 | def _collect_buildset(
|
166 | 128 | requirements, # type: Iterable[InstallRequirement]
|
167 | 129 | wheel_cache, # type: WheelCache
|
@@ -252,7 +214,7 @@ def _build_one_inside_env(
|
252 | 214 | # type: (...) -> Optional[str]
|
253 | 215 | with TempDirectory(kind="wheel") as temp_dir:
|
254 | 216 | if req.use_pep517:
|
255 |
| - wheel_path = _build_wheel_pep517( |
| 217 | + wheel_path = build_wheel_pep517( |
256 | 218 | name=req.name,
|
257 | 219 | backend=req.pep517_backend,
|
258 | 220 | metadata_directory=req.metadata_directory,
|
|
0 commit comments