-
Notifications
You must be signed in to change notification settings - Fork 74
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
Allow to use different hashing algorithms #133
Conversation
💖 Thanks for opening this pull request! 💖 Please make sure you read our contributing guidelines and abide by our code of conduct. A few things to keep in mind:
|
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.
@Xarthisius thank you for taking the time to implement this! 🎉 I was actually just thinking of this a couple of days ago. I left a few comments (mostly minor) that need to be addressed before moving forward. Let me know if you need any feedback/help/opinion.
pooch/tests/utils.py
Outdated
} | ||
return registry | ||
|
||
|
||
def add_hash_algs(registry): |
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.
Would this be a useful function to have in pooch/core.py
? The same code is used in Pooch.__init__
.
@Xarthisius thanks for making those changes. Looks like this is almost good to go! Only need some text in the docstrings about specifying the hash algorithms and that one comment about the If you have the time, it would also be nice to have a short section in |
It would also be nice to have at least 1 test using a different hash algorithm. |
Co-Authored-By: Leonardo Uieda <leouieda@gmail.com>
44d993f
to
e994336
Compare
@leouieda I believe I addressed all the comments. I'd appreciate a 2nd review. |
@Xarthisius looks good to me 👍 Merging this in! Thank you for the contribution to Pooch! It's much appreciated. Please feel free to open another PR adding yourself to the AUTHORS.md file (if you want, of course). |
🎉🎉🎉 Congrats on merging your first pull request and welcome to the team! 🎉🎉🎉 Please open a new pull request to add yourself to the |
Rationale
I'm trying to use pooch to manage/fetch data stored in external data repositories. All of them provide some sort of checksum, unfortunately it's not always SHA256. Ideally I'd like to generate pooch's registry file using hashes obtained directly from a given data repository. However, I need to be able to use proper hashing algorithm for data verification.
Implementation
Extend registry format from:
to
Whenever old format registry is detected (i.e.
:
is not present in hash)sha256:
is prepended to the hash automatically, which ensures backward compatibility.TODO