From c6a43e92f91df8cd133f8e13800c3dbc4b113bb4 Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Thu, 15 Feb 2024 17:34:42 -0600 Subject: [PATCH] Add `UV_NO_CACHE` environment variable (#1383) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It's a little picky about the value, but that seems okay. ``` ❯ ./target/debug/uv pip install trio Audited 1 package in 4ms ❯ UV_NO_CACHE=true ./target/debug/uv pip install trio Audited 1 package in 50ms ``` Closes #1382 --- crates/uv-cache/src/cli.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/crates/uv-cache/src/cli.rs b/crates/uv-cache/src/cli.rs index 200409d62..90a87da06 100644 --- a/crates/uv-cache/src/cli.rs +++ b/crates/uv-cache/src/cli.rs @@ -11,7 +11,13 @@ use crate::Cache; #[derive(Parser, Debug, Clone)] pub struct CacheArgs { /// Avoid reading from or writing to the cache. - #[arg(global = true, long, short, alias = "no-cache-dir")] + #[arg( + global = true, + long, + short, + alias = "no-cache-dir", + env = "UV_NO_CACHE" + )] no_cache: bool, /// Path to the cache directory.