astral-sh/uv

uv tool upgrade - problem with private indexes due to short living credentials

Open

#8,523 opened on Oct 24, 2024

View on GitHub
 (10 comments) (4 reactions) (0 assignees)Rust (84,934 stars) (3,111 forks)batch import
bughelp wanteduv tool

Description

I am using uv tool install to install some CLI tools from private index (CodeArtifact).

When new version is released, uv tool upgrade generally fails. I have a mechanism that refreshes CodeArtifact index URL with new credentials and stores them in ~/.config/uv/uv.toml, but when tools are installed, index used is stored in uv-receipt.toml as far as I can tell and upgrade is trying to use that again. It usually fails, because those credentials are good only for couple hours.

Workaround is uv tool uninstall <tool> && uv tool install <tool>.

Should upgrade use globally defined index if stored one fails? Maybe only if domain is the same (but ignore credentials)? Not sure what the best approach is here, but it would be good for upgrade to work.

Happy to provide any additional details if needed.

❯ uv --version
uv 0.4.26 (1b9b9d56b 2024-10-23)

Contributor guide