uv icon indicating copy to clipboard operation
uv copied to clipboard

Allow setting a target version for `uv self update`

Open hofrob opened this issue 1 year ago • 1 comments

what

Add cli/env parameter to uv self update to allow updating to a given uv version. Right now, running uv self update will update to the latest version. According to the docs (uv self update --help and uv help self update) there is no way to define the target version.

why

This would help in the CI and dev environments. All these environments should use the same version to be able to reproduce bugs or dependency issues for example.

side effect

No unnecessary API requests ("is there a new version?") during CI jobs.

how

  • uv self update --target 0.3.3 (-t)
  • uv self update --target-version 0.3.3 (-t)
  • uv self update --uv-version 0.3.3 (-u)
  • uv self update --to 0.3.3 (-t)

additional

Similarly, listing available versions + github release link via something like uv self versions might be a good idea.

hofrob avatar Aug 26 '24 12:08 hofrob

This is supported upstream, e.g., https://github.com/axodotdev/cargo-dist/blob/c92b9a1ab36ff8fe0173c80a951a045eed81a760/cargo-dist/src/main.rs#L597-L607

zanieb avatar Aug 29 '24 17:08 zanieb