File tree 2 files changed +14
-0
lines changed
src/pip/_internal/operations
2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change
1
+ Prevent downloading files twice when PEP 658 metadata is present
Original file line number Diff line number Diff line change @@ -471,6 +471,19 @@ def _complete_partial_requirements(
471
471
logger .debug ("Downloading link %s to %s" , link , filepath )
472
472
req = links_to_fully_download [link ]
473
473
req .local_file_path = filepath
474
+ # TODO: This needs fixing for sdists
475
+ # This is an emergency fix for #11847, which reports that
476
+ # distributions get downloaded twice when metadata is loaded
477
+ # from a PEP 658 standalone metadata file. Setting _downloaded
478
+ # fixes this for wheels, but breaks the sdist case (tests
479
+ # test_download_metadata). As PyPI is currently only serving
480
+ # metadata for wheels, this is not an immediate issue.
481
+ # Fixing the problem properly looks like it will require a
482
+ # complete refactoring of the `prepare_linked_requirements_more`
483
+ # logic, and I haven't a clue where to start on that, so for now
484
+ # I have fixed the issue *just* for wheels.
485
+ if req .is_wheel :
486
+ self ._downloaded [req .link .url ] = filepath
474
487
475
488
# This step is necessary to ensure all lazy wheels are processed
476
489
# successfully by the 'download', 'wheel', and 'install' commands.
You can’t perform that action at this time.
0 commit comments