pypa/pipx

Check for latest version before running with `pipx run`

Open

#464 ouverte le 10 août 2020

Voir sur GitHub
 (12 commentaires) (2 réactions) (0 assignés)Python (363 forks)batch import
enhancementhelp wanted

Métriques du dépôt

Stars
 (7 844 stars)
Métriques de merge PR
 (Merge moyen 5j 2h) (16 PRs mergées en 30 j)

Description

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.

Guide contributeur