Skip to content

Commit 767bb40

Browse files
committed
Canonicalize package names before comparison for PEP658 metadata
1 parent 5f0dd4c commit 767bb40

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

news/12038.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix installation of packages with PEP658 metadata using non-canonicalized names

src/pip/_internal/operations/prepare.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ def _fetch_metadata_using_link_data_attr(
410410
# NB: raw_name will fall back to the name from the install requirement if
411411
# the Name: field is not present, but it's noted in the raw_name docstring
412412
# that that should NEVER happen anyway.
413-
if metadata_dist.raw_name != req.req.name:
413+
if canonicalize_name(metadata_dist.raw_name) != canonicalize_name(req.req.name):
414414
raise MetadataInconsistent(
415415
req, "Name", req.req.name, metadata_dist.raw_name
416416
)

0 commit comments

Comments
 (0)