-
Notifications
You must be signed in to change notification settings - Fork 28
Junk leftover when installing a new version after installing github tarball. #50
Comments
This issue is related to this SUMO bug https://bugzilla.mozilla.org/show_bug.cgi?id=1074861 |
I verified @mythmon's findings. pip works fine, peep does not. Grabbing this one to look into because ick. |
I wouldn't be surprised if it had to do with wheels. That's a new code path, after all. One way or another, though, pip is installing the second package without removing the first. peep doesn't install anything; it just calls pip. Thanks for having a look, Will. |
The eminent @erikrose is right on. If I do a strict reproduction of what peep is doing where it downloads the item first, then installs from the file it downloaded, then I can reproduce the problem with pip, too. I trolled the pip issue tracker and I'm pretty sure it's this issue: That's fixed in their develop branch, but hasn't made it into a release, yet. If I add the I think we have a few options in rough order of difficulty:
I'm inclined to go with option 1. It's easy to do and people can stop using the argument when they're using a version of pip that works right and we don't have to make any tricky code changes. Further, I'm pretty sure @mythmon and @dean ran into a problem where sometimes pip downloads the wheel and sometimes not, so you have to have two hashes in the requirements file otherwise you occasionally get hash failures--this would alleviate that, too. Option 2 would prevent a bunch of errors from users who didn't read the docs or didn't read that part of the docs or didn't read the updated docs, etc. So it's probably more user-friendly, maybe? Option 3 is there because the other two options were lonely and it's always nice to have at least three options even if one of them is a "wtf--worst idea ever" option. Any thoughts? |
I like 2 because…
One concern, though: are there intersections of command-line options that will fight with --no-use-wheel or its absence? For example, if the user passes --no-use-wheel himself and we add another one, will pip freak out? Was there a --use-wheel (positive) in previous versions of pip that will clash with our added --no-use-wheel? |
After working on bug #1074861 (peep issue #50), I decided we shouldn't use wheels for now. The crux of the issue is that if you have a github-tarball based requirement and then switch to a pypi based requirement which downloads a wheel, then pip doesn't clean things up properly and you end up with cruft in your virtual environment which includes .py, .pyc and metadata files. Ew. Further Mike and Dean said they've had instances where peep downloads a wheel and then a non-wheel, so you need to have both hashes in the requirements file. Ew. Because of these two issues, it's easier to not do wheels. So I updated peep to the latest and then modified it so it's always passing --no-use-wheel to pip. I also fixed the shas in the requirements file that were for wheels. Plus when testing all of this, I had a problem where the vagrant provisioning script was creating /root/.pip and dying with a permission issue. So I fixed that, too. * https://bugzilla.mozilla.org/show_bug.cgi?id=1074861 * erikrose/peep#50
Excellent questions! I have no idea how to figure that out short of downloading every version of pip since they added wheel support to see what the available flags were. Is there a better way? |
I'd be happy to settle for making sure passing --no-use-wheel manually doesn't crash peep/pip. |
So, we have two outstanding questions here:
Once we have those two answered, I'm game for fixing this. If someone else could spend the time to figure out the answers, that'd be great! Otherwise I'll try to get to it this week. |
SUMO had some issues with pip versions so I went and read through the release notes to determine which versions supported wheels and which did not. I think this is an exhaustive list of which released, stable versions support wheels as of today. In particular, it is everything after 1.4.0. For completeness, these are all the versions that support wheels today:
Edit: the trouble on SUMO was with pip versions, not peep versions. |
I looked at the pip install arguments and didn't see anything exciting. Further, I think this suggests there aren't other wheel-related arguments currently: http://pip.readthedocs.org/en/latest/user_guide.html#installing-from-wheels Given that and @mythmon's comment, I think we can add something like:
The theory being that we ban wheels for now and once they do a pip release that fixes it, we can edit the above check to be upper-bounded by whatever the fixed version is. Does that sound good? |
Make and activate a virtualenv.
Install something with a github url.
Install the same library, but a new version, from pypi
$ cat pypi.txt # sha256: CnOPMnGcdnU38yYRjBBcIZ5nfna3hUfthHxqqvvKDGU elasticutils==0.10.1 $ peep install -r pypi.txt
Observe that the metadata for the both the first and second installation of the package exist at once.
Be sad.
I'm not sure if the contents of the actual package (
venv/lib/python2.6/site-packages/elasticutils
) is entirely the new version, or if it is a mash-up of the old version and the new version. I don't know elasticutils well enough to tell right now.When installing from pypi, peep/pip opted to download a wheel file. I'm not sure if this is relavent.
Pip does not have this behavior. It's logs contain a few lines that indicate it is removing old versions before installing the new versions. Peep's logs do not contain any mention of this.
The text was updated successfully, but these errors were encountered: