mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-03 18:38:21 +00:00
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
4 changed files with 22 additions and 10 deletions
|
@ -13,6 +13,10 @@ repository = { workspace = true }
|
|||
authors = { workspace = true }
|
||||
license = { workspace = true }
|
||||
|
||||
[[bin]]
|
||||
name = "gourgeist"
|
||||
required-features = ["cli"]
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
|
@ -23,7 +27,8 @@ puffin-interpreter = { path = "../puffin-interpreter" }
|
|||
|
||||
anstream = { workspace = true }
|
||||
camino = { workspace = true }
|
||||
clap = { workspace = true, features = ["derive"] }
|
||||
clap = { workspace = true, features = ["derive"], optional = true }
|
||||
directories = { workspace = true }
|
||||
fs-err = { workspace = true }
|
||||
serde = { workspace = true }
|
||||
serde_json = { workspace = true }
|
||||
|
@ -32,3 +37,6 @@ thiserror = { workspace = true }
|
|||
tracing = { workspace = true }
|
||||
tracing-subscriber = { workspace = true }
|
||||
which = { workspace = true }
|
||||
|
||||
[features]
|
||||
cli = ["clap"]
|
||||
|
|
|
@ -2,15 +2,13 @@
|
|||
|
||||
set -e
|
||||
|
||||
cd "$(git rev-parse --show-toplevel)"
|
||||
|
||||
virtualenv --version
|
||||
|
||||
#cargo build --profile profiling
|
||||
cargo build --release #--features parallel
|
||||
# Benchmarking trick! strip your binaries ٩( ∂‿∂ )۶
|
||||
strip target/release/gourgeist
|
||||
cargo build --profile profiling --bin gourgeist --features cli
|
||||
|
||||
echo "## Bare"
|
||||
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"
|
||||
echo "## Default"
|
||||
hyperfine --warmup 1 --prepare "rm -rf target/a" "virtualenv -p 3.11 target/a" "target/release/gourgeist -p 3.11 target/a"
|
||||
hyperfine --warmup 1 --shell none --prepare "rm -rf target/venv-benchmark" \
|
||||
"target/profiling/gourgeist -p 3.11 target/venv-benchmark" \
|
||||
"virtualenv -p 3.11 --no-seed target/venv-benchmark"
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ use std::time::Instant;
|
|||
use anstream::eprintln;
|
||||
use camino::Utf8PathBuf;
|
||||
use clap::Parser;
|
||||
use directories::ProjectDirs;
|
||||
use tracing::info;
|
||||
use tracing_subscriber::layer::SubscriberExt;
|
||||
use tracing_subscriber::util::SubscriberInitExt;
|
||||
|
@ -27,7 +28,11 @@ fn run() -> Result<(), gourgeist::Error> {
|
|||
let location = cli.path.unwrap_or(Utf8PathBuf::from(".venv"));
|
||||
let python = parse_python_cli(cli.python)?;
|
||||
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();
|
||||
create_bare_venv(&location, &info)?;
|
||||
Ok(())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue