Support wheel cache when using --require-hashes#11042
Support wheel cache when using --require-hashes#11042
Conversation
998eef7 to
ce5e145
Compare
| verbosity: int, | ||
| download_dir: Optional[str] = None, | ||
| hashes: Optional[Hashes] = None, | ||
| archive_hash: Optional[str] = None, |
There was a problem hiding this comment.
Passing this archive_hash to unpack_url and then to get_file_url is the ugly part.
I think we could clean this up by avoiding calling unpack_url when the url points to a wheel in the wheel cache (as it does not unpack anyway).
If people are ok with general approach I'll investigate that next.
There was a problem hiding this comment.
Passing archive_hash around like this feels wrong, especially get_file_url (if it’s passed, a bulk of the logic in the function isn’t used at all). This should be refactored a bit.
|
To illustrate, {
"archive_info": {
"hash": "sha256=b62ffa81fb85f4332a4f609cab4ac40709470da05643a082ec1eb88e6d9b97d7"
},
"url": "https://files.pythonhosted.org/packages/82/f7/e43cefbe88c5fd371f4cf0cf5eb3feccd07515af9fd6cf7dbf1d1793a797/wrapt-1.12.1.tar.gz"
} |
df712bb to
ae0acff
Compare
|
Going to go ahead and close this, since it has merge conflicts that haven't been resolved in a while. Please feel welcome to file a new PR or to reopen and update this one! |
This is a very rough sketch, to get an idea of how well this fits in the existing code base and get initial feedback.
This works by recording a
origin.jsonin the wheel cache directory entries (in PEP 610 format).I'll annotate the diff with the parts that need refactoring IMO. @pypa/pip-committers feel free to suggest others.
closes #5037