Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions news/12208.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Implement lazier lazy_wheel that avoids the HEAD request, fetching the metadata
for many wheels in 1 request.
6 changes: 4 additions & 2 deletions src/pip/_internal/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,12 +329,14 @@ class UnsupportedWheel(InstallationError):
class InvalidWheel(InstallationError):
"""Invalid (e.g. corrupt) wheel."""

def __init__(self, location: str, name: str):
def __init__(self, location: str, name: str, context: str | None = None):
self.location = location
self.name = name
self.context = context

def __str__(self) -> str:
return f"Wheel '{self.name}' located at {self.location} is invalid."
suffix = f" ({self.context})" if self.context else ""
return f"Wheel '{self.name}' located at {self.location} is invalid{suffix}."


class MetadataInconsistent(InstallationError):
Expand Down
Loading
Loading