-
Notifications
You must be signed in to change notification settings - Fork 3.1k
install --timeout ignored #70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
+1, the timeout parameter doesn't seem to be passed on, working on it. |
pull request opened to fix this issue. The problem was that default initial options were overring any value specified. |
Unfortunately that fix isn't correct, it just replaces one problem with another one. The basic problem is that the line changed in your commit is fundamentally incorrect for an option with a non-False default (such as I do think the precedence you switched it to is slightly better, in that if you (for some reason) do But it doesn't solve the core problem - we need a better way of handling these options other than looking for them twice with two separate parsers and then naively trying to merge the two sets of options with the wrong assumption that an option's default value will always be falsy. The easiest answer would be if we could tell the global parser to parse the whole arglist (instead of just up to the first non-option), but ignore any bad options it finds (so that the command's option parser can still find them). Then the command option parsers wouldn't need to look for global options at all, and there would be no need for merging options. Unfortunately optparse provides no way to say "ignore bad options", and it seems like making it do so in a subclass would involve extensive surgery with internals. So I'm not sure the best way to address this yet; need to think on it more. |
One super-simple option would be to simply require that global options must be supplied before the command name. That would simplify the code, remove the need for merging options at all, and fix this bug. But it might not be an acceptable restriction. @jezdez you've worked more with the config system, any thoughts on what would be an acceptable solution to this? |
i agree with you on the latest point, it's a counter intuitive restriction to only allow "pip --timeout 1 instal ..." I understand now why this patch isn't correct, that also means my test suite isn't enough, i'll add the proper tests when i've got the time. |
Speaking of that test, I think tests for this option-parsing issue need to be a bit broader in scope, not unit tests of just |
(Also, note that there's already a |
maybe the right work here would be precisely to separate the parser part from the BaseCommand class in order for it to be more testable (as an independent part of the system). |
"--log-file" is also ignored. When I run pip with '--log-file /tmp/X/X.log', the value can't be changed, it's always "~/.pip/pip.log" |
@gvalkov , interested in this? read the history above. I haven't looked at this close. |
Sure. Since sub-parsers actually know of the options in the 'Generic Options' option group, why not get rid of Currently
Let's just make it pass all arguments to the command parser:
Here's a quick jab at the problem (tests pass). Tell me if you like this approach and I'll polish it. |
Hi @gvalkov. I think it is the way to go. There are some bugs reported because of |
Sure. Here's a commit that you can cherry-pick and a test build. Can send a pull request later if necessary. |
fixed in PR #1202 |
I am attempting to use pip to install Traits, but it fails with a url timeout error. easy_install will install Traits, but it takes about 30 seconds after the command is issued before the download begins. So I tried running "pip install --timeout=60 Traits", but it raised the same error after about 15 seconds. Then I tried "pip install --timeout=1 Traits" and it timed out after 15 seconds again.
I don't think this option is being respected.
The text was updated successfully, but these errors were encountered: