@@ -260,8 +260,9 @@ def unpack_url(
260
260
)
261
261
262
262
# unpack the archive to the build dir location. even when only downloading
263
- # archives, they have to be unpacked to parse dependencies
264
- unpack_file (file .path , location , file .content_type )
263
+ # archives, they have to be unpacked to parse dependencies, except wheels
264
+ if not link .is_wheel :
265
+ unpack_file (file .path , location , file .content_type )
265
266
266
267
return file
267
268
@@ -390,20 +391,14 @@ def _ensure_link_req_src_dir(self, req, download_dir, parallel_builds):
390
391
"""Ensure source_dir of a linked InstallRequirement."""
391
392
# Since source_dir is only set for editable requirements.
392
393
if req .link .is_wheel :
393
- if download_dir :
394
- # When downloading, we only unpack wheels to get
395
- # metadata.
396
- autodelete_unpacked = True
397
- else :
398
- # When installing a wheel, we use the unpacked wheel.
399
- autodelete_unpacked = False
400
- else :
401
- # We always delete unpacked sdists after pip runs.
402
- autodelete_unpacked = True
394
+ # We don't need to unpack wheels, so no need for a source
395
+ # directory.
396
+ return
403
397
assert req .source_dir is None
398
+ # We always delete unpacked sdists after pip runs.
404
399
req .ensure_has_source_dir (
405
400
self .build_dir ,
406
- autodelete = autodelete_unpacked ,
401
+ autodelete = True ,
407
402
parallel_builds = parallel_builds ,
408
403
)
409
404
0 commit comments