We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 69e28eb commit 3c508cbCopy full SHA for 3c508cb
src/pip/_internal/operations/prepare.py
@@ -360,9 +360,15 @@ def _fetch_metadata_using_pep_658(
360
self._download,
361
hashes=metadata_link.as_hashes(),
362
)
363
+ # The file will be downloaded under the same name as it's listed in the index,
364
+ # which will end with .metadata. To make importlib.metadata.PathDistribution
365
+ # work, we need to keep it in the same directory, but rename it to METADATA.
366
+ containing_dir = os.path.dirname(metadata_file.path)
367
+ new_metadata_path = os.path.join(containing_dir, "METADATA")
368
+ os.rename(metadata_file.path, new_metadata_path)
369
assert req.req is not None
370
return get_metadata_distribution(
- metadata_file.path,
371
+ new_metadata_path,
372
req.link.filename,
373
req.req.name,
374
0 commit comments