Closed Bug 1047020 Opened 7 years ago Closed 7 years ago

Peep Install Occasionally Fails

Categories

(Socorro :: Infra, task)

x86_64
Linux
task
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: bramwelt, Assigned: bramwelt)

Details

If you forget on occasion to use a python2.6 virtualenv, pip will grab a wheel from pypi instead of the tarball. This is not anything in our control, and can be fixed by adding the hashes for pep8 and pyflakes wheels.

Each of these should still be independently verified.

pep8

wheel: https://pypi.python.org/packages/3.3/p/pep8/pep8-1.5.7-py2.py3-none-any.whl#md5=e64cf25ebf3ee49b1ab18ee7fb225d41
tarball: https://pypi.python.org/packages/source/p/pep8/pep8-1.5.7.tar.gz#md5=f6adbdd69365ecca20513c709f9b7c93

pyflakes

wheel: https://pypi.python.org/packages/3.3/p/pyflakes/pyflakes-0.8.1-py2.py3-none-any.whl#md5=a9810b19e048e77ba1ce5364a77aa32e
tarball: https://pypi.python.org/packages/source/p/pyflakes/pyflakes-0.8.1.tar.gz#md5=905fe91ad14b912807e8fdc2ac2e2c23
I'm still a noob when it comes to wheels but it looks like those wheels are only made for python 3. So doing `pip install pep8|pyflakes` in python 2(.6) should only get us the tranditional tarballs.
The wheel for pep8 on pypi is not specific to python3. It was build as a universal wheel, meaning it works for both python 2 and 3.

The wheel[1] docs provide a fuller explanation of wheels and the "universal=1" option.

Pip's documentation[2] on why this happens is also enlightening: "Pip prefers Wheels where they are available. To disable this, use the –no-use-wheel flag for pip install."

[1] http://wheel.readthedocs.org/en/latest/index.html#defining-the-python-version
[2] http://pip.readthedocs.org/en/latest/user_guide.html#installing-from-wheels
A ha! I think I finally get it. You mean that even in python 2, you can sometimes get the wheel and that's why you need two shas. r+
Yup! :)
Commits pushed to master at https://github.com/mozilla/socorro

https://github.com/mozilla/socorro/commit/aeca029d983b2d2467bebf06017e6e01c1b8d44e
Add pep8, pyflakes wheel hash to requirements

Also pins pep8 at 1.5.7.

PyPI will send back wheels or tarballs, and there is no way to know
which will come back when installing a package through pip.

Fixes bug 1047020

https://github.com/mozilla/socorro/commit/72383734c9bc290553de810ae35c8db7507fe875
Merge pull request #2263 from bramwelt/add-wheel-hashes-to-requirements

fix bug 1047020 - Add Wheel Hashes to Requirements
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
A ha! I think I finally get it. You mean that even in python 2, you can sometimes get the wheel and that's why you need two shas. r+
Target Milestone: --- → 97
Target Milestone: 97 → 98
You need to log in before you can comment on or make changes to this bug.