Pack you uv environment for offline usage.
Project description
uv-pack
Bundle a locked uv environment into a self-contained, offline-installable directory.
The output includes pinned requirements, third-party wheels, locally built wheels,
and a portable Python interpreter.
What it does
- Exports a
requirements.txtfrom youruvlock file. - Downloads third-party wheels into
pack/wheels/. - Builds local workspace packages into
pack/vendor/. - Downloads a python-build-standalone archive into
pack/python/(unless--system). - Writes
unpack.sh,unpack.ps1, andunpack.cmdto unpack the resulting venv offline.
Install
Install uv-pack as a dev-dependency or as a uv tool.
uv add --dev uv-pack
# or install as a tool
uv tool install uv-pack
Once installed, run using:
uv run uv-pack --help
# or as a tool
uv tool run uv-pack --help
# or using uvx (equivalent)
uvx uv-pack --help
CLI
uv-pack [OUTPUT_DIRECTORY (default = ./pack)]
Options:
--uv-export: extra args passed touv export--pip-download: extra args passed topip download--uv-build-sdist: extra args passed touv buildfor downloaded sdists--uv-build-pkg: extra args passed touv buildfor local packages--no-clean: keep the output directory instead of wiping--include-dev: include dev dependencies--system: skip bundling Python; requireBASE_PYat unpack time
Example
uv-pack --include-dev
Output layout
pack/
requirements.txt
wheels/
vendor/
python/ # (omitted with --system)
unpack.sh
unpack.ps1
unpack.cmd
README.md
Unpack and install offline
POSIX (sh/bash/zsh):
./pack/unpack.sh
PowerShell:
.\pack\unpack.ps1
Windows cmd:
.\pack\unpack.cmd
All scripts also accept VENV_DIR, PY_DEST and BASE_PY environment variables.
Use BASE_PY when --system was used during packing to provide a system
python interpreter. VENV_DIR (default = .venv) and PY_DEST (default = .python)
can be used to customize the target python and venv diretory.
Configuration
UV_PYTHON_INSTALL_MIRROR can override the GitHub API endpoint to retrieve the
Python releases, default is:
https://api.github.com/repos/astral-sh/python-build-standalone/releases/latest.
GITHUB_TOKEN can be used to authenticate the request to the GitHub API to
prevent possible rate-limiting.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file uv_pack-0.0.1.tar.gz.
File metadata
- Download URL: uv_pack-0.0.1.tar.gz
- Upload date:
- Size: 10.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
064ab0ba316e5fec220fcf226d0b493f43501f3d1eb71662c736621d07ee97cb
|
|
| MD5 |
d28a1568513de0f0c631aaa2a8862632
|
|
| BLAKE2b-256 |
a9778f0060a5122cc7a1dfcf4a5060f0d9049eb52d996f9cc26a0a97b380b382
|
File details
Details for the file uv_pack-0.0.1-py3-none-any.whl.
File metadata
- Download URL: uv_pack-0.0.1-py3-none-any.whl
- Upload date:
- Size: 14.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1a42efa6c6676a3db374cac03790499e2e606d006f4074d8156cab6bbd28cb4e
|
|
| MD5 |
01ce7457d8d44f75a0fde1d1d4ec26a9
|
|
| BLAKE2b-256 |
822043f2084ff704f98d45c3e8410ff3a189c31d26fd3a72a5e9469d24eb26a1
|