-
Notifications
You must be signed in to change notification settings - Fork 28
Add --no-use-wheel to default pip install arguments #53
Conversation
@erikrose I tried to do the minimum changes I could get away with that worked. In the issue, I suggested we leave it unbounded until pip releases a version that works. I bounded it in this patch--I'm kind of on the fence about which way is best. Thoughts? |
What happens if a user says |
If someone specifies I don't see a |
Oh. I made an assumption without actually checking the docs. There is no option, and I'm just being silly. I have no more objections. +1 from me. |
pip 1.4.0 through 1.5.6 (and possibly later versions which haven't come out, yet) support wheels, but don't upgrade them correctly. So instead of dealing with virtual environments that can grow cruft, it's better to just not use wheels for now. This adds ``--no-use-wheel`` to the default pip install arguments to prevent pip from using wheels. Fixes #50
^^^ That checks for the argument first before applying. |
Bah. pip 1.4 has a |
^^^ That handles things correctly with the two different arguments in the two different versions of pip. Yay. |
if pip.__version__ >= '1.5' and pip.__version__ <= '1.5.6' and '--no-use-wheel' not in initial_args: | ||
initial_args.insert(1, '--no-use-wheel') | ||
|
||
print('>>> ', initial_args) |
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.
Debug line?
^^^ Bah. Nixed the debug statement. |
A horrible thought: what if someone wants to use wheels for speed (imagine some package where compiling takes forever) but always starts from a blank virtualenv? Then we'd be taking away perfectly good functionality, from their viewpoint. What's more, this is a very reasonable scenario, since there's no facility yet for removing packages from a venv that are no longer in the requirements file—if you don't want an ever-growing venv full of cruft, you have to start fresh. I wonder if we could take into account whether the package is already installed before freaking out about the wheel option. (Search for the "req.satisfied_by" check.) |
if pip.__version__ >= '1.4' and pip.__version__ < '1.5' and '--use-wheel' in initial_args: | ||
initial_args.remove('--use-wheel') | ||
|
||
if pip.__version__ >= '1.5' and pip.__version__ <= '1.5.6' and '--no-use-wheel' not in initial_args: |
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.
Can we really get away with all these stringwise comparisons? If we ever get to 1.5.10, I could imagine trouble. I bet there's a tuple-ized rendition of the pip version number floating around somewhere.
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.
According to the pip bug, there will be no 1.5.7 and the next version will be 1.6.
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.
But '1.10' < '1.4'.
I'm kind of hitting the end of my "what if..." handling abilities. Right now SUMO updates are busted in regards to upgrades, so there's some urgency in fixing this. @mythmon is loathe to edit his peep locally (I'm not--I already fixed this for fjord (though I need to tweak that fix)), so I think it needs to be fixed upstream for SUMO's purposes. peep has no tests. I know you worked on that last night, but I doubt we'll have a sufficient test suite that I'm comfortable about doing complex solutions to this. Thus I'm trying real hard to keep this as simple as possible and that probably means we can't satisfy everyone. Hopefully this is a stopgap until pip 1.6 comes out and then people can do whatever it is they want to do again. If they don't like that, they can edit their version of peep which is made easier because the code in question is in one place and pretty clearly documented. So because of time and complexity constraints (plus I'm not wildly interested in spending a lot more time on this) I think I have these options:
|
A couple of discrete thoughts:
|
# | ||
# This prevents pip from using wheels for those versions. | ||
if pip.__version__ >= '1.4' and pip.__version__ < '1.5' and '--use-wheel' in initial_args: | ||
initial_args.remove('--use-wheel') |
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.
Let's construct a new list rather than mutating the arg. Mutating could lead to some very tricky bugs down the road.
I've got bug https://bugzilla.mozilla.org/show_bug.cgi?id=1074900 covering removing things from the virtualenv. I'm planning to fix that, too, so I'm not worried about that use case. Generating a new virtualenv every deploy is pretty intense unless someone figures out a good caching solution. |
Also, if we're expecting people to be deleting virtualenvs and creating new ones, then we don't need this and we should just end it here. |
The typical As for deleting venvs, that's a best practice IMO, but individuals can make that tradeoff. peep is a repeatable installer, not a full-on deployment tool. That's more where I was targeting Shiva. |
Given that, I vote we switch gears back to option 1 in comment #50 (comment) in #50. That seems to be the best option given the various use cases discussed here and it's the simplest solution, too. I'll close this PR out and do one for a docs change. |
pip 1.4.0 through 1.5.6 (and possibly later versions which haven't come
out, yet) support wheels, but don't upgrade them correctly. So instead
of dealing with virtual environments that can grow cruft, it's better to
just not use wheels for now.
This adds
--no-use-wheel
to the default pip install arguments toprevent pip from using wheels.
Fixes #50