diff --git a/Cargo.lock b/Cargo.lock index 5466f637e..dafa75f56 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1237,6 +1237,7 @@ name = "gourgeist" version = "0.0.4" dependencies = [ "anstream", + "cachedir", "camino", "clap", "directories", diff --git a/crates/gourgeist/Cargo.toml b/crates/gourgeist/Cargo.toml index a0d7a97ec..91e6b5bd6 100644 --- a/crates/gourgeist/Cargo.toml +++ b/crates/gourgeist/Cargo.toml @@ -26,6 +26,7 @@ uv-cache = { path = "../uv-cache" } uv-interpreter = { path = "../uv-interpreter" } anstream = { workspace = true } +cachedir = { workspace = true } camino = { workspace = true } clap = { workspace = true, features = ["derive"], optional = true } directories = { workspace = true } diff --git a/crates/gourgeist/src/bare.rs b/crates/gourgeist/src/bare.rs index efb2e0355..91831af95 100644 --- a/crates/gourgeist/src/bare.rs +++ b/crates/gourgeist/src/bare.rs @@ -108,6 +108,10 @@ pub fn create_bare_venv(location: &Utf8Path, interpreter: &Interpreter) -> io::R }; let bin_dir = location.join(bin_name); + // Add the CACHEDIR.TAG. + cachedir::ensure_tag(&location)?; + + // Create a `.gitignore` file to ignore all files in the venv. fs::write(location.join(".gitignore"), "*")?; // Different names for the python interpreter