Skip to content

Commit

Permalink
fix venv path
Browse files Browse the repository at this point in the history
  • Loading branch information
ibraheemdev committed Apr 26, 2024
1 parent 161239d commit 872c3d6
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions crates/bench/benches/uv.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
//! Benchmarks uv using criterion.
//!
//! The benchmarks in this file assume that the `uv` and `virtualenv` executables are available.
//!
//! To set up the required environment, run:
//!
//! ```shell
//! cargo build --release
//! ./target/release/uv venv
//! source .venv/bin/activate
//! ./target/release/uv pip sync ./scripts/bench/requirements.txt
//! ```

use std::env;
use std::path::Path;
use std::process::{Command, Stdio};
Expand All @@ -23,8 +36,8 @@ fn resolve_warm(c: &mut Criterion<WallTime>) {
);

let temp_dir = tempfile::tempdir().unwrap();
let output_file = Path::new("./requirements.txt");
let cache_dir = Path::new("./.cache");
let output_file = Path::new("requirements.txt");
let cache_dir = Path::new(".cache");

c.bench_function(&name, |b| {
b.iter_batched(
Expand Down Expand Up @@ -58,7 +71,7 @@ fn install_warm(c: &mut Criterion<WallTime>) {
requirements.file_stem().unwrap().to_string_lossy()
);

let venv_dir = fs::canonicalize("./.venv").unwrap();
let venv_dir = Path::new(".venv");
env::set_var("VIRTUAL_ENV", &venv_dir);

let temp_dir = tempfile::tempdir().unwrap();
Expand Down

0 comments on commit 872c3d6

Please sign in to comment.