Skip to content

Commit 64f887f

Browse files
committed
Don't unpack wheel files after building for install
Actual installation has been using the wheel file directly for some time. The last piece that required an unpacked wheel was metadata. Now that it uses the wheel file directly, we can remove the unpacking after build.
1 parent 586e2f7 commit 64f887f

File tree

1 file changed

+0
-23
lines changed

1 file changed

+0
-23
lines changed

src/pip/_internal/wheel_builder.py

-23
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,11 @@
1313
from pip._internal.operations.build.wheel import build_wheel_pep517
1414
from pip._internal.operations.build.wheel_legacy import build_wheel_legacy
1515
from pip._internal.utils.logging import indent_log
16-
from pip._internal.utils.marker_files import has_delete_marker_file
1716
from pip._internal.utils.misc import ensure_dir, hash_file
1817
from pip._internal.utils.setuptools_build import make_setuptools_clean_args
1918
from pip._internal.utils.subprocess import call_subprocess
2019
from pip._internal.utils.temp_dir import TempDirectory
2120
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
22-
from pip._internal.utils.unpacking import unpack_file
2321
from pip._internal.utils.urls import path_to_url
2422
from pip._internal.vcs import vcs
2523

@@ -313,27 +311,6 @@ def build(
313311
req.link = Link(path_to_url(wheel_file))
314312
req.local_file_path = req.link.file_path
315313
assert req.link.is_wheel
316-
if should_unpack:
317-
# XXX: This is mildly duplicative with prepare_files,
318-
# but not close enough to pull out to a single common
319-
# method.
320-
# The code below assumes temporary source dirs -
321-
# prevent it doing bad things.
322-
if (
323-
req.source_dir and
324-
not has_delete_marker_file(req.source_dir)
325-
):
326-
raise AssertionError(
327-
"bad source dir - missing marker")
328-
# Delete the source we built the wheel from
329-
req.remove_temporary_source()
330-
# set the build directory again - name is known from
331-
# the work prepare_files did.
332-
req.source_dir = req.ensure_build_location(
333-
self.preparer.build_dir
334-
)
335-
# extract the wheel into the dir
336-
unpack_file(req.link.file_path, req.source_dir)
337314
build_successes.append(req)
338315
else:
339316
build_failures.append(req)

0 commit comments

Comments
 (0)