Skip to content

Commit

Permalink
update message for MetadataIncohsistent to allow use with PEP 658 met…
Browse files Browse the repository at this point in the history
…adata
  • Loading branch information
cosmicexplorer committed Sep 7, 2022
1 parent fc9bcdd commit 036bfc0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions src/pip/_internal/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,8 @@ class MetadataInconsistent(InstallationError):
"""Built metadata contains inconsistent information.
This is raised when the metadata contains values (e.g. name and version)
that do not match the information previously obtained from sdist filename
or user-supplied ``#egg=`` value.
that do not match the information previously obtained from sdist filename,
user-supplied ``#egg=`` value, or an install requirement name.
"""

def __init__(
Expand All @@ -349,8 +349,7 @@ def __init__(

def __str__(self) -> str:
template = (
"Requested {} has inconsistent {}: "
"filename has {!r}, but metadata has {!r}"
"Requested {} has inconsistent {}: expected {!r}, but metadata has {!r}"
)
return template.format(self.ireq, self.field, self.f_val, self.m_val)

Expand Down
2 changes: 1 addition & 1 deletion tests/functional/test_new_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -1363,7 +1363,7 @@ def test_new_resolver_skip_inconsistent_metadata(script: PipTestEnvironment) ->
)

assert (
" inconsistent version: filename has '3', but metadata has '2'"
" inconsistent version: expected '3', but metadata has '2'"
) in result.stdout, str(result)
script.assert_installed(a="1")

Expand Down

0 comments on commit 036bfc0

Please sign in to comment.