-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Fall back to distributions without hashes in resolver #2949
Conversation
sha256:123 | ||
|
||
Computed: | ||
sha256:5d69f0b590514103234f0c3526563856f04d044d8d0ea1073a843ae429b3187e |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These aren't as nice-looking, but keep in mind that for --require-hashes
, the user has to pin all dependencies upfront anyway. There's no backtracking or anything.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They're pretty ugly but 🤷♂️ we could address later if we want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Absolutely DESTROYING my error messages
f66887c
to
cdb2449
Compare
19505ca
to
6f897d2
Compare
cdb2449
to
32a2088
Compare
6f897d2
to
fc6c30c
Compare
32a2088
to
d8f5d37
Compare
fc6c30c
to
fdd87aa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah this UX seems much better.
669384d
to
e3f5242
Compare
fdd87aa
to
d3b6023
Compare
Summary
This represents a change to
--require-hashes
in the event that we don't find a matching hash from the registry. The behavior in this PR is closer to pip's.Prior to this PR, if a distribution had no reported hash, or only mismatched hashes, we would mark it as incompatible. Now, we mark it as compatible, but we use the hash-agreement as part of the ordering, such that we prefer any distribution with a matching hash, then any distribution with no hash, then any distribution with a mismatched hash.
As a result, if an index reports incorrect hashes, but the user provides the correct one, resolution now succeeds, where it would've failed.
Similarly, if an index omits hashes altogether, but the user provides the correct one, resolution now succeeds, where it would've failed.
If we end up picking a distribution whose hash ultimately doesn't match, we'll reject it later, after resolution.