mirror of https://github.com/astral-sh/uv
Gourgeist updates (#862)
* Use caching again * Make clap feature only required for the cli/bin optional
This commit is contained in:
parent
e67b7858e6
commit
1203f8f9e8
|
|
@ -1173,6 +1173,7 @@ dependencies = [
|
||||||
"anstream",
|
"anstream",
|
||||||
"camino",
|
"camino",
|
||||||
"clap",
|
"clap",
|
||||||
|
"directories",
|
||||||
"fs-err",
|
"fs-err",
|
||||||
"platform-host",
|
"platform-host",
|
||||||
"puffin-cache",
|
"puffin-cache",
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,10 @@ repository = { workspace = true }
|
||||||
authors = { workspace = true }
|
authors = { workspace = true }
|
||||||
license = { workspace = true }
|
license = { workspace = true }
|
||||||
|
|
||||||
|
[[bin]]
|
||||||
|
name = "gourgeist"
|
||||||
|
required-features = ["cli"]
|
||||||
|
|
||||||
[lints]
|
[lints]
|
||||||
workspace = true
|
workspace = true
|
||||||
|
|
||||||
|
|
@ -23,7 +27,8 @@ puffin-interpreter = { path = "../puffin-interpreter" }
|
||||||
|
|
||||||
anstream = { workspace = true }
|
anstream = { workspace = true }
|
||||||
camino = { workspace = true }
|
camino = { workspace = true }
|
||||||
clap = { workspace = true, features = ["derive"] }
|
clap = { workspace = true, features = ["derive"], optional = true }
|
||||||
|
directories = { workspace = true }
|
||||||
fs-err = { workspace = true }
|
fs-err = { workspace = true }
|
||||||
serde = { workspace = true }
|
serde = { workspace = true }
|
||||||
serde_json = { workspace = true }
|
serde_json = { workspace = true }
|
||||||
|
|
@ -32,3 +37,6 @@ thiserror = { workspace = true }
|
||||||
tracing = { workspace = true }
|
tracing = { workspace = true }
|
||||||
tracing-subscriber = { workspace = true }
|
tracing-subscriber = { workspace = true }
|
||||||
which = { workspace = true }
|
which = { workspace = true }
|
||||||
|
|
||||||
|
[features]
|
||||||
|
cli = ["clap"]
|
||||||
|
|
|
||||||
|
|
@ -2,15 +2,13 @@
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
cd "$(git rev-parse --show-toplevel)"
|
||||||
|
|
||||||
virtualenv --version
|
virtualenv --version
|
||||||
|
|
||||||
#cargo build --profile profiling
|
cargo build --profile profiling --bin gourgeist --features cli
|
||||||
cargo build --release #--features parallel
|
|
||||||
# Benchmarking trick! strip your binaries ٩( ∂‿∂ )۶
|
|
||||||
strip target/release/gourgeist
|
|
||||||
|
|
||||||
echo "## Bare"
|
hyperfine --warmup 1 --shell none --prepare "rm -rf target/venv-benchmark" \
|
||||||
hyperfine --warmup 1 --prepare "rm -rf target/a" "virtualenv -p 3.11 --no-seed target/a" "target/release/gourgeist -p 3.11 --bare target/a"
|
"target/profiling/gourgeist -p 3.11 target/venv-benchmark" \
|
||||||
echo "## Default"
|
"virtualenv -p 3.11 --no-seed target/venv-benchmark"
|
||||||
hyperfine --warmup 1 --prepare "rm -rf target/a" "virtualenv -p 3.11 target/a" "target/release/gourgeist -p 3.11 target/a"
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ use std::time::Instant;
|
||||||
use anstream::eprintln;
|
use anstream::eprintln;
|
||||||
use camino::Utf8PathBuf;
|
use camino::Utf8PathBuf;
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
|
use directories::ProjectDirs;
|
||||||
use tracing::info;
|
use tracing::info;
|
||||||
use tracing_subscriber::layer::SubscriberExt;
|
use tracing_subscriber::layer::SubscriberExt;
|
||||||
use tracing_subscriber::util::SubscriberInitExt;
|
use tracing_subscriber::util::SubscriberInitExt;
|
||||||
|
|
@ -27,7 +28,11 @@ fn run() -> Result<(), gourgeist::Error> {
|
||||||
let location = cli.path.unwrap_or(Utf8PathBuf::from(".venv"));
|
let location = cli.path.unwrap_or(Utf8PathBuf::from(".venv"));
|
||||||
let python = parse_python_cli(cli.python)?;
|
let python = parse_python_cli(cli.python)?;
|
||||||
let platform = Platform::current()?;
|
let platform = Platform::current()?;
|
||||||
let cache = Cache::temp()?;
|
let cache = if let Some(project_dirs) = ProjectDirs::from("", "", "gourgeist") {
|
||||||
|
Cache::from_path(project_dirs.cache_dir())?
|
||||||
|
} else {
|
||||||
|
Cache::from_path(".gourgeist_cache")?
|
||||||
|
};
|
||||||
let info = Interpreter::query(python.as_std_path(), platform, &cache).unwrap();
|
let info = Interpreter::query(python.as_std_path(), platform, &cache).unwrap();
|
||||||
create_bare_venv(&location, &info)?;
|
create_bare_venv(&location, &info)?;
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue