Feat: support multiple hash algorithms#6490
Conversation
for more information, see https://pre-commit.ci
6023951 to
b4758d8
Compare
|
Pretty sure that this is at best a part of the solution: it's not enough to verify an md5 hash against a value in a lockfile, you also need to persuade poetry to put a non-sha256 hash into the lockfile in the first place. Also you are likely calculating the same hash again and again, which is undesirable |
|
I have a PR cooking locally that attempts to solve this holistically -- however, I confess that reworking hash handling in a way that we can backport is rather difficult, and it may be easier to just forward-port the change from the 1.1 branch and consider the holistic rework something for 1.3 only. |
|
Thx for the quick review, I've been late to the party. Please help me figure out if I'm reading this correctly: When the lock file contains the package with its file+hash:
When the lock file does not contains the package, Poetry will add a hash of the package according to the specific repository implementation, e.g.
If I understand correctly, the issues triggered by v1.2 regarding hashes are:
|
|
The problem (with Nexus at least) is that the repo hashes do change for all versions of a package whenever any new version is pushed for that package. |
|
Why aren't we merging it? |
|
As others have pointed, I don't think this is good enough. That particular piece of code has already been written in a better way on 1.1 branch, also other matters need to be addressed, particularly regarding the chooser and the pipy adapter. I'll complete this MR before next week with a more solid implementation. It will not cover any scenario but will at least provide guidance in case the install from non-sha256 repos doesn't work (instructing to perform another lock). From what I've seen a better management of hashes requires some refactoring and changes to poetry-core (which is not the focus of that MR). |
Wonderful! Let me know how I can help. I don't have much experience with contributing to open source, but I am good enough with python. |
|
|
Superseded by #8118 |
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Pull Request Check List
Resolves: #6301 #4085
Updated documentation for changed code.