Closed paddyroddy closed 1 month ago
Thanks for the report!
cc @lucaspar, from the doc, looks like the self-update feature is only available if your uv
is installed through the official script:
When uv is installed via the standalone installer, it can update itself on-demand
Hopefully, we can find a way to check if an installation is done in such a way, or we have to remove this operation🤔.
This issue is quite similar to #892, see this comment.
Oh, I just realized that even though this issue is similar to that one, but this one is pretty easy to fix, we can simply check if the self update sub-command exists or not, and only involve it if exists
You should use the package manager that installed uv
to upgrade itself (the brew step in this case). The step is working as expected and your uv
installed tools are being upgraded:
DEBUG Executing command /opt/homebrew/bin/uv tool upgrade --all
Nothing to upgrade
See the comment in https://github.com/topgrade-rs/topgrade/blob/main/src/steps/generic.rs#L1034-L1044
Hmm, just found we already ignored the execution result of that command, perhaps we should hide the output as well?
I chose to not hide it because
If we're trying to improve UX, maybe we can add a custom log message from topgrade on error to tell the user that this "error" is (probably) ok.
A different route is to try uv self --help
first - if it succeeds, we call uv self update
. Otherwise we skip it to let homebrew (or another manager) handle it.
A different route is to try
uv self --help
first - if it succeeds, we calluv self update
. Otherwise we skip it to let homebrew (or another manager) handle it.
This is what I think, we try the command uv self --help
and capture the output, if it fails, then we skip this step. Otherwise, do the self-update.
I think the current solution is good. But personally, I'd rather uv
didn't even feature in the list in this case (without manually disabling it).
── 16:07:35 - uv ───────────────────────────────────────────────────────────────
error: uv was installed through an external package manager, and self-update is not available. Please use your package manager to update uv.
Nothing to upgrade
It's listed because uv-installed tools are updated regardless of uv's installation mode.
── 16:07:35 - uv ───────────────────────────────────────────────────────────────
error: uv was installed through an external package manager, and self-update is not available. Please use your package manager to update uv.
Nothing to upgrade
This is also feasible as we can check if it is installed through the official scrip via uv self --help
Erroneous Behavior
It's trying to update
uv
withself update
Expected Behavior
Update
uv
Steps to reproduce
topgrade run uv
Possible Cause (Optional)
I don't believe
self
is an option foruv
Problem persists without calling from topgrade
Did you run topgrade through
Remote Execution
If yes, does the issue still occur when you run topgrade directlly in your remote host
Configuration file (Optional)
Additional Details
Operation System/Version:
macOS 15.0.1
Installation
homebrew
Topgrade version (
topgrade -V
) topgrade 16.0.1Verbose Output (
topgrade -v
)