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.

Check for latest version before running with `pipx run`

See original GitHub issue

How would this feature be useful?

When using pipx run someapp, a version of someapp is cached for 14 days. There could be new releases within that timeframe that could be useful to have.

Describe the solution you’d like

I think my ideal solution would be to just automatically check for a newer version and upgrade if it exists. If you’re already on the latest version, use the cache.

The next best solution (which would avoid any backwards compatibility issues) would be pipx run --latest someapp, that would work the same way but require an explicit flag.

A third solution, that might work well with the second, is having some sort of config you can set (e.g. ~/.pipxrc) that lets you say you always want the --latest flag.

Describe alternatives you’ve considered

The only real workaround I’ve found is to run the app a second time without cache, then a third time with the cache. This also only works if you know the version has changed and want to force it to change. For example:

pipx run someapp --version # v0.1.0
# some new update comes out
pipx run --no-cache someapp --version # v0.1.1
pipx run someapp --version # v0.1.1

Some downsides:

  • If the app has a lot of dependencies, running --no-cache every time will be pretty inefficient.
  • If you don’t always run with --no-cache, you need to know somehow if there’s a version update
  • If you want to update once with --no-cache, it will delete the cache the first time and download the latest version, then the second time it’ll download it again but actually cache it.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
uranusjrcommented, Aug 18, 2020

The Simple API is HTML (PEP 503), and pip uses it as the primary package discovery API, so it’s extremely likely to be supported by any given repository implementation.

0reactions
anthem-bmkcommented, Aug 18, 2020

It looks like Artifactory does actually support the pypi Simple API, but not JSON. So if we went Simple all the way that could work… not sure how many other projects there are out there to support private repos and whether they also support the API. Looks like it’s XML so it’s not as easy to parse as JSON, but like @uranusjr said there are clients out there for that.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Check for latest version before running with pipx run #464
When using pipx run someapp , a version of someapp is cached for 14 days. There could be new releases within that timeframe...
Read more >
pipx — Install and Run Python Applications in Isolated ...
This way you can be sure you're always running a new version of the package without having to manually upgrade. If the app...
Read more >
Docs - pipx
Runs `pip install -U <pkgname>` for each package. uninstall Uninstall a ... all packages list List installed packages run Download the latest version...
Read more >
Troubleshooting - pipx
Note: If your pipx-installed package was installed using a pipx version ... To check for pip environment variables, execute the following depending on...
Read more >
Examples - pipx
pipx enables you to test various combinations of Python versions and package versions in ephemeral environments: pipx run BINARY # latest version of...
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