Add --exit-code to make install --dry-run return non-zero when packages would be installed#13803
Add --exit-code to make install --dry-run return non-zero when packages would be installed#13803flying-sausages wants to merge 4 commits intopypa:mainfrom
--exit-code to make install --dry-run return non-zero when packages would be installed#13803Conversation
|
Should this get some tests? |
|
Sorry, I misread your request, I was thinking you were asking for when dry run fails. If it succeeds but would install something I don't think that should be non-zero. But I do agree it would be good to programmatically tell the difference, I think it might be possible by using an installation report, I will try and look later today after work. |
|
The amount of tests failing suggest that there's a precedent with the expectation that this will continue working as is. I still do think there's value in having a non-zero return for a dry-run which reports changes, would it be an option to add an extra flag such as |
install --dry-run return ERROR if requirements not satisfied--exit-code to make install --dry-run return non-zero when packages would be installed
f6574dd to
9667c03
Compare
|
Unfortunately I don't think this use case warrants yet another flag, and like our tests users might be dependent on our exit codes. If we did decide this required special exit code behavior I would rather go through a deprecation cycle where we warn users that we are going to change the behavior. And I don't think this use case warrants that either. In the mean time see my example of implementing this programmatically with existing tools: #13802 (comment). In fact, I might switch our tests to use this. |
|
Hmm I see. Makes sense. |
Fixes #13802