astral-sh / uv

An extremely fast Python package and project manager, written in Rust.
https://docs.astral.sh/uv
Apache License 2.0
22.32k stars 652 forks source link

FR: Support installing and managing `uv` with `uv tool` #6400

Open weihenglim opened 1 month ago

weihenglim commented 1 month ago

Currently the documentation's recommended way of installing uv is via pipx. With the release of uv tool, it would be great to let uv manage itself, similar to how you can do pipx install pipx.

When testing on my Windows 11 machine, uv tool install uv works but the tool breaks when attempting to upgrade uv to the latest version:

> uv tool upgrade uv 
Resolved 1 package in 38ms
Prepared 1 package in 1ms
Installed 1 package in 8ms
 + uv==0.3.1
error: failed to remove file `C:\Users\User\.local\bin\uv.exe`
  Caused by: Access is denied. (os error 5)

> uv tool list
warning: Ignoring malformed tool `uv` (run `uv tool uninstall uv` to remove)
charliermarsh commented 1 month ago

Ahh yeah, that's a known issue on Windows: https://github.com/astral-sh/uv/issues/1368. You should be able to do uv self update if you installed via the standalone installers (as opposed to through pip or similar).

weihenglim commented 1 month ago

Ah that's a shame, was hoping it would be possible to just upgrade everything (including uv itself) with a single uv tool upgrade --all command. Guess I'll stick with the standalone installers for now.

zanieb commented 1 month ago

I'm not sure it makes sense to manage uv with uv, it creates a weird chicken and egg problem. You can definitely do uvx uv@version though!

konstin commented 1 month ago

rustup update updates both its managed toolchains, then does a self update, we should consider a similar convenience function for uv.

zanieb commented 1 month ago

Hm like uv upgrade?

Could be cool.