pipx install not quite idempotent
See original GitHub issueHi. I’m writing scripts to install multiple packages via pipx (thank you for writing it!). I want these scripts to be idempotent (i.e. running it a second time has no impact after running it once, and it still succeeds). I also want to know when there are errors during installation. However, the current way pipx install
is implemented makes those two conflicting goals.
Running pipx install foo
a second time does nothing more than running it just once (except print a message the second time saying “Not installing to existing directory …”), which is good. However, the exit code for that second time is set to a non-zero value. So either I ignore the exit code, and then pipx install foo
is idempotent, but I don’t know if there was an error. Or I look at the exit code, and then I’ll know if the install failed, but then running it a second time is not the same as once (because it fails with a non-zero exit code the second time).
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
cc @itsayellow @gaborbernat
Feel free to submit a PR for this.