-
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
Add option to cause non-zero exit code if pip install
caused conflicting packages
#10512
Comments
Can you describe the specific use cases and benefits you expect to get from this? The cost of a In addition, we'd be changing the meaning of the return code - at present I believe that a non-zero return code means that pip didn't install anything, and left the environment unchanged. I'm pretty sure there will be people who rely on that fact, so we either break their workflows, or (as in your example) we add a flag that changes the meaning of the return code, which would cause confusion. And you'd still need to distinguish between "install failed, no change" and "install succeeded, but pip check failed", so you'd need a different return code. If we were designing pip from scratch, this might be a reasonable feature to have, but given where we are now, I'm not sure it's worth it. But as I say, if the uses you're thinking of are compelling, that might change my mind. |
Those are good points, and I'm afraid that my reasons aren't particularly compelling.
I'm not sure that the direction that I'm proposing is worth the complexity that Feel free to close this (due to the proposed solution likely not being worth its costs) or keep it open (to represent slightly increased ergonomics around catching conflicts in environments). |
Thanks for your reply. I'll leave it open for now, to let the other maintainers comment if they wish. |
I’d name the option |
I'm ambivalent -- "meh" is probably the best way to summarise my position. I think the actual change of making this fail is straightforward:
One good thing to do though, would be to abort prior to making the installation + doing the wheel builds; which can save a bunch of work. |
What's the problem this feature will solve?
I'm writing tooling around
pip
, and I would like it to "fail fast" when an environment has conflicting packages.Describe the solution you'd like
In #7744, it's discussed how it's currently not feasible to block a
pip install
from happening if will cause conflicts.However, in today's behaviour,
pip install
does an internal equivalent ofpip check
at the end to check for conflicts.My feature request here is for that internal
pip check
to return a non-zero exit code if conflicts are detected.This allows scripts that run
pip install <package> --return-exit-code-if-conflicts-are-caused-please
to stop immediately after conflicts are caused.Alternative Solutions
I'm currently running
pip check
after eachpip install
, which is essentially doubling the amount of "conflict-checking" that's happening.Additional context
Thanks!
Code of Conduct
The text was updated successfully, but these errors were encountered: