Skip to content

Set the requirement context on hash error #8445

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 24, 2020
Merged
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
9 changes: 7 additions & 2 deletions src/pip/_internal/resolution/resolvelib/candidates.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from pip._vendor.packaging.utils import canonicalize_name
from pip._vendor.packaging.version import Version

from pip._internal.exceptions import MetadataInconsistent
from pip._internal.exceptions import HashError, MetadataInconsistent
from pip._internal.req.constructors import (
install_req_from_editable,
install_req_from_line,
Expand Down Expand Up @@ -171,7 +171,12 @@ def _prepare(self):
if self._dist is not None:
return

abstract_dist = self._prepare_abstract_distribution()
try:
abstract_dist = self._prepare_abstract_distribution()
except HashError as e:
e.req = self._ireq
raise

self._dist = abstract_dist.get_pkg_resources_distribution()
assert self._dist is not None, "Distribution already installed"

Expand Down