Closed edmorley closed 6 years ago
Thanks for the report @edmorley. This is expected, so I'm going to close this.
It's worth noting here that it's no longer possible for releases to have two different types of source distributions, so this really will only affect folks pinning hashes for older releases (as you have noted).
For anyone else encountering this issue, generally I'd recommend adding hashes for all distributions for a given release, possibly with a tool like hashin:
$ hashin -r requirements.txt some_project==1.2.3
Hi!
We make use of pip's
--require-hashes
mode and so explicitly list package hashes in our requirements file: https://github.com/mozilla/treeherder/blob/e7743cb491d1ea20fbdc4abcb4dda1f4cb4f229a/requirements/common.txtHowever after purging a local development environment virtualenv, I'm now getting hash mismatch errors for two packages:
Neither of these packages have had new uploads recently and we've pinned pip to version 9.0.1 so are using the same version as previously.
Checking the "expected" vs "got" hashes against the available downloads for each package, it seems that the hash mismatches are due to a different file being chosen rather than anything malicious. For example:
.tar.gz
vs.zip
in the case of functools32...-py2.py3-none-any.whl
vs...-py2-none-any.whl
for uritemplateI'm presuming this is due to the recent changes to the https://pypi.python.org/simple/ API here: https://github.com/pypa/pypi-legacy/commit/66d8673d2e445499d8e7e5f491ba4703d5609e04 https://github.com/pypa/pypi-legacy/commit/85dd4477cc1c7afe8a4d71b9422d63ded447daa2 https://github.com/pypa/pypi-legacy/commit/c01a83406b118b313eb1ab0119a0cdd9af8901eb
There doesn't appear to be a PR for them so hard to see whether this behaviour change was intended?
As for our project, it's easy for me to add the additional package hashes to fix the breakage - so if this is wontfix that's fine - I just thought I should report it in case not expected. (We now use https://pyup.io to update dependencies, so future package updates will always have all hashes listed; these two packages just haven't had new versions in a while, so had not been touched by the bot.)