-
Notifications
You must be signed in to change notification settings - Fork 3k
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
pip install
exits successfully when arguments are invalid
#2720
Comments
Thanks, @xavfernandez! |
I don't consider this behavior a bug, but a form of graceful degradation, handling
Without the graceful degradation, for a script to handle the empty set without erroring, it first has to resolve Another real-world example is rwt, where in the 1.14 release filters dependencies based on what's installed, and may invoke pip install with the empty set. Additionally to consider, what does it mean to invoke
I think the previous behavior was more consistent, powerful, and friendly. |
The reason I filed this bug is because, previously, an empty I agree there was an argument for pushing the behavior in either direction. But I think the UX for the end user here is really important. If an empty I'd advocate for a flag like |
The message that was printed was rendered on my screen in yellow, indicating to me that it was a warning and not an error. Therefore, it's not even a mismatch. Of course, if you don't have the color highlighting, I could see how it might appear like an error. There are many other cases where pip outputs warnings but exits with a non-error status (such as warning about new versions available).
Are you saying that it should also exit with a non-zero status code when requirements.txt is empty unless that flag is passed? Personally, I'd prefer one, consistent behavior, even if that's to fail on nothing to install. Speaking of use-cases, what is the use-case for returning a non-zero exit code when no requirements are specified? |
As someone who commented on the PR for this, I have some sympathy for @jaraco's position. The exit status is essentially for scripting use, the message for user consumption, so there's a justification for the warning + success status approach originally used. I don't script pip in this way myself, so I don't have a vested interest in any particular result, but I just wanted to be clear on where I stand. |
This seems like a bug, considering:
The text was updated successfully, but these errors were encountered: