Skip to content

Commit

Permalink
move metadata tests from using download to install
Browse files Browse the repository at this point in the history
- this allows us to fully make use of @pfmoore's earlier hotfix
  • Loading branch information
cosmicexplorer committed Aug 1, 2023
1 parent 3dc5ac5 commit 7ad477e
Show file tree
Hide file tree
Showing 3 changed files with 464 additions and 431 deletions.
14 changes: 1 addition & 13 deletions src/pip/_internal/operations/prepare.py
Original file line number Diff line number Diff line change
Expand Up @@ -480,19 +480,7 @@ def _complete_partial_requirements(
logger.debug("Downloading link %s to %s", link, filepath)
req = links_to_fully_download[link]
req.local_file_path = filepath
# TODO: This needs fixing for sdists
# This is an emergency fix for #11847, which reports that
# distributions get downloaded twice when metadata is loaded
# from a PEP 658 standalone metadata file. Setting _downloaded
# fixes this for wheels, but breaks the sdist case (tests
# test_download_metadata). As PyPI is currently only serving
# metadata for wheels, this is not an immediate issue.
# Fixing the problem properly looks like it will require a
# complete refactoring of the `prepare_linked_requirements_more`
# logic, and I haven't a clue where to start on that, so for now
# I have fixed the issue *just* for wheels.
if req.is_wheel:
self._downloaded[req.link.url] = filepath
self._downloaded[req.link.url] = filepath

# This step is necessary to ensure all lazy wheels are processed
# successfully by the 'download', 'wheel', and 'install' commands.
Expand Down
Loading

0 comments on commit 7ad477e

Please sign in to comment.