uv
uv copied to clipboard
"uv download" to create local directory of distributions + ability to install from the same
Summary
I am looking for options to archive my dependencies' distributions, primarily for bundling reproducible scientific workflows for archival and distribution.
I see some discussion about functionality like venv-pack or conda-pack (#8653, #6970), but they seem to be primarily about archiving the extracted virtual environment.
I think another solution could provide a lot of the same benefits, including supporting airgapped installs, without the need for solving the various arcane problems involved in bundling and relocating entire virtual environments: the ability to bundle the distributions, optionally also including the wheels built from sdists. The basic idea has two parts:
- A command, maybe
uv downloador a new option foruv export, that copies the distributions from the cache into a specified directory, for either the current platform or all locked platforms. - An option to
uv syncthat uses the files from the exported directory (possibly just pre-seeding them into the cache).
Example
Preparing the archive:
$ uv download --all-platforms -o dist/dependencies/
248 distributions downloaded
Installing from archive:
$ uv sync --dist-archive dist/dependencies
Related
- https://github.com/astral-sh/uv/issues/3163
I think the downloaded archive would be in structure the same as a flat index, so, all that's needed for installing it is a flat index pointing at that directory, right? Can a flat index be specified on the CLI?
Separately, as noted in the linked pip downlaod discussion, is it perhaps more appropriate to provide the equivalent of pip wheel (or at least a flag for it) since it builds wheels for packages which don't come with a pre-built one.