[Python] lock specific dependency versions with `uvx` (uv tool run)

Discussão em 'Python' iniciado por Stack, Abril 18, 2025.

  1. Stack

    Stack Membro Participativo

    I can request a specific version of tool and python when using uv's tool functionality, e.g.:

    uvx --python=3.10 --from="jupyterlab@4.0.10" jupyter-lab


    But I don't see a way to pin dependencies to make sure subsequent invocations will not silently auto-update (possibly breaking) something. The docs say:


    uvx will use the latest available version of the requested tool on the first invocation. After that, uvx will use the cached version of the tool unless a different version is requested, the cache is pruned, or the cache is refreshed.
    ​

    ...and apparently the cache can get refreshed without me asking for it explicitly, as I caught the above command suddenly reinstalling the tool instead of reusing an existing environment.

    For uv projects and scripts there's a lock command and related --frozen/--locked parameters, but nothing seems to be available for tools?

    I found some tangentially related issues (#5815, #10082), but nothing explicitly about this, so I feel I'm missing something obvious.

    Continue reading...

Compartilhe esta Página