uv icon indicating copy to clipboard operation
uv copied to clipboard

`uv self update` should support `--dry-run`

Open jmknoble opened this issue 1 year ago • 2 comments

I want uv to tell me whether it thinks it needs an update, before I actually tell it to update.

The most straightforward pattern for this would seem to be supporting --dry-run (which uv lock already supports). uv self update doen't currently support that:

$ uv --version
uv 0.5.7 (3ca155ddd 2024-12-06)
$ uv self update --dry-run
error: unexpected argument '--dry-run' found

  tip: to pass '--dry-run' as a value, use '-- --dry-run'

Usage: uv self update [OPTIONS] [TARGET_VERSION]

For more information, try '--help'.
$ uv --dry-run self update
error: unexpected argument '--dry-run' found

Usage: uv [OPTIONS] <COMMAND>

For more information, try '--help'.
$ 

Possible alternatives:

  • uv self list-updates (clunky?)
  • uv self update list (ripe for human error)
  • uv self update --list (ditto)
  • uv self list (better, more like uv python list, may need uv self install too? (and maybe uv python update should be a command as well?))
  • uv self versions (different name, same action as uv self list, no real precedent though)

jmknoble avatar Dec 12 '24 00:12 jmknoble

Makes sense, I honestly thought this existed.

charliermarsh avatar Dec 12 '24 00:12 charliermarsh

I started looking into this. Unfortunately fetch_release is not public (https://github.com/axodotdev/axoupdater/blob/1ce5efa7b73e16437bc757c6ca21963ddf18fc45/axoupdater/src/release/mod.rs#L91) and is_update_needed only returns a bool (https://github.com/axodotdev/axoupdater/blob/1ce5efa7b73e16437bc757c6ca21963ddf18fc45/axoupdater/src/lib.rs#L302) so we can't say what version we'll update to. But... better than nothing.

zanieb avatar Dec 12 '24 01:12 zanieb