question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

pipx install not quite idempotent

See original GitHub issue

Hi. 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:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
uranusjrcommented, Sep 21, 2021
1reaction
uranusjrcommented, Sep 21, 2021

Feel free to submit a PR for this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting - pipx
This is a good fix for the following problems: System python was upgraded and the python used with a pipx-installed package is no...
Read more >
Pipx cannot be install on windows #659 - GitHub
Describe the bug I'm currently trying to install pipx within my windows machine, and it seems that is not able to detect my...
Read more >
pipenv Documentation - Read the Docs
To install pipx, just run: $ pip install --user pipx. Once you have pipx ready on your system, continue to install Pipenv: $...
Read more >
Tips and Resources for writing better Shell Scripts
Here are some helpful Tips & Resources you can use to write better shell scripts ;)
Read more >
Yes, yes, yes! This is what I've been waiting for so long ...
Since these files aren't idempotent, we can't reliably cache the results (these ... Whl archives ship extracted, cacheable metadata, not the setup script....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found