Skip to content

Allow using latest with extras in uvx #11321

@unexge

Description

@unexge

Summary

The following fails today, though I think it should work:

$ uvx --from 'httpx[cli]@latest' httpx
  × Failed to resolve tool requirement
  ╰─▶ Distribution not found at: file:///Users/unexge/Code/uv/latest

The following works fine:

$ uvx --from 'httpx[cli]' httpx
$ uvx --from 'httpx[cli] == 0.28' httpx

uvx version is uv-tool-uvx 0.5.29 (ca73c4754 2025-02-05).


By looking at debug logs:

$ RUST_LOG=debug uvx --from 'httpx[cli]@latest' httpx
DEBUG uv 0.5.29 (ca73c4754 2025-02-05)
DEBUG Ignoring non-package name `httpx[cli]` in `--from`
DEBUG Searching for default Python interpreter in managed installations or search path
DEBUG Searching for managed installations at `/Users/unexge/.local/share/uv/python`
DEBUG Found `cpython-3.13.0-macos-aarch64-none` at `/opt/homebrew/bin/python3` (first executable in the search path)
DEBUG Acquired lock for `/Users/unexge/.local/share/uv/tools`
DEBUG Checking for Python environment at `/Users/unexge/.local/share/uv/tools/httpx`
DEBUG Released lock at `/Users/unexge/.local/share/uv/tools/.lock`
DEBUG Assessing Python executable as base candidate: /opt/homebrew/opt/python@3.13/bin/python3.13
DEBUG Assessing Python executable as base candidate: /opt/homebrew/opt/python@3.13/Frameworks/Python.framework/Versions/3.13/bin/python3.13
DEBUG Caching via base interpreter: `/opt/homebrew/opt/python@3.13/bin/python3.13`
DEBUG Using request timeout of 30s
  × Failed to resolve tool requirement
  ╰─▶ Distribution not found at: file:///Users/unexge/Code/uv/latest

It seems like uvx run into this case and thinks it's a local distribution: https://github.com/astral-sh/uv/blob/main/crates/uv/src/commands/tool/mod.rs#L50

Example

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions