uv icon indicating copy to clipboard operation
uv copied to clipboard

"uv download" to create local directory of distributions + ability to install from the same

Open mdekstrand opened this issue 7 months ago • 2 comments

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:

  1. A command, maybe uv download or a new option for uv export, that copies the distributions from the cache into a specified directory, for either the current platform or all locked platforms.
  2. An option to uv sync that 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

mdekstrand avatar May 05 '25 16:05 mdekstrand

Related

  • https://github.com/astral-sh/uv/issues/3163

zanieb avatar May 05 '25 16:05 zanieb

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.

tingerrr avatar Nov 25 '25 09:11 tingerrr