mirror of
https://github.com/astral-sh/uv.git
synced 2025-07-07 13:25:00 +00:00

This PR massively speeds up the case in which you need to install wheels that already exist in the global cache. The new strategy is as follows: - Download the wheel into the content-addressed cache. - Unzip the wheel into the cache, but ignore content-addressing. It turns out that writing to `cacache` for every file in the zip added a ton of overhead, and I don't see any actual advantages to doing so. Instead, we just unzip the contents into a directory at, e.g., `~/.cache/puffin/django-4.1.5`. - (The unzip itself is now parallelized with Rayon.) - When installing the wheel, we now support unzipping from a directory instead of a zip archive. This required duplicating and tweaking a few functions. - When installing the wheel, we now use reflinks (or copy-on-write links). These have a few fantastic properties: (1) they're extremely cheap to create (on macOS, they are allegedly faster than hard links); (2) they minimize disk space, since we avoid copying files entirely in the vast majority of cases; and (3) if the user then edits a file locally, the cache doesn't get polluted. Orogene, Bun, and soon pnpm all use reflinks. Puffin is now ~15x faster than `pip` for the common case of installing cached data into a fresh environment. Closes https://github.com/astral-sh/puffin/issues/21. Closes https://github.com/astral-sh/puffin/issues/39.
52 lines
1.6 KiB
TOML
52 lines
1.6 KiB
TOML
[package]
|
|
name = "install-wheel-rs"
|
|
version = "0.0.1"
|
|
edition = "2021"
|
|
description = "Takes a wheel and installs it, either in a venv or for monotrail"
|
|
license = "MIT OR Apache-2.0"
|
|
repository = "https://github.com/konstin/poc-monotrail"
|
|
keywords = ["wheel", "python"]
|
|
|
|
[lib]
|
|
name = "install_wheel_rs"
|
|
|
|
[dependencies]
|
|
platform-host = { path = "../platform-host" }
|
|
wheel-filename = { path = "../wheel-filename" }
|
|
|
|
clap = { workspace = true, optional = true, features = ["derive", "env"] }
|
|
configparser = { workspace = true }
|
|
csv = { workspace = true }
|
|
data-encoding = { workspace = true }
|
|
fs-err = { workspace = true }
|
|
fs2 = { workspace = true }
|
|
glibc_version = { workspace = true }
|
|
goblin = { workspace = true }
|
|
mailparse = { workspace = true }
|
|
once_cell = { workspace = true }
|
|
platform-info = { workspace = true }
|
|
plist = { workspace = true }
|
|
pyo3 = { version = "0.19.2", features = ["extension-module", "abi3-py37"], optional = true }
|
|
rayon = { version = "1.8.0", optional = true }
|
|
reflink-copy = { workspace = true }
|
|
regex = { workspace = true }
|
|
rfc2047-decoder = { workspace = true }
|
|
serde = { workspace = true, features = ["derive"] }
|
|
serde_json = { workspace = true }
|
|
sha2 = { workspace = true }
|
|
target-lexicon = { workspace = true }
|
|
tempfile = { workspace = true }
|
|
thiserror = { workspace = true }
|
|
tracing = { workspace = true }
|
|
tracing-subscriber = { workspace = true, optional = true }
|
|
walkdir = { workspace = true }
|
|
zip = { workspace = true }
|
|
|
|
[features]
|
|
default = ["cli", "parallel"]
|
|
python_bindings = ["pyo3", "tracing-subscriber"]
|
|
cli = ["clap"]
|
|
parallel = ["rayon"]
|
|
|
|
[dev-dependencies]
|
|
indoc = {version = "2.0.4"}
|