astral-sh / uv

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

Add "lockfile" for uv tools? #6931

Open baggiponte opened 1 month ago

baggiponte commented 1 month ago

Ciao! I could not find any mention of it, but I was wondering whether you would consider adding a tools section under uv.receipt, or another lockfile-like lib where uv is configured, to retain a list of tools installed.

My usecase would be that my install.sh script does not need to be updated everytime I want a new tool to be globally available with uv 😅 In general, I think that would make uv more "reproducible" across different machines that a user may be using it for. I don't think it should stay in a section below the "global" uv.toml file, though.

charliermarsh commented 1 month ago

We store a per-tool receipt at, e.g., /Users/crmarsh/.local/share/uv/tools/black/uv-receipt.toml. But it's not a lockfile, it just contains the installation request (e.g., the version bounds, any settings) to support uv tool upgrade.

jinnatar commented 2 weeks ago

Something like this would be very useful for preserving how the tools were installed. Say, if I do a:

uv tool install twine --with keyring-pass

.. It would be nice if this lockfile then remembers that --with and allows me to then repro that on another machine. It's available in the uv-receipt.toml:

[tool]
requirements = [
    { name = "twine" },
    { name = "keyring-pass" },
]

.. but I don't think any current invocation is even capable of showing that it's there. I could of course script around exporting the receipts, but since that hardcodes the entrypoint paths I imagine that path is filled with pain.