Skip to content

Commit

Permalink
Disable uv cache on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
j178 committed Dec 8, 2024
1 parent 5513f74 commit 548e9a1
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 21 deletions.
10 changes: 0 additions & 10 deletions .config/nextest.toml

This file was deleted.

7 changes: 0 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ fs2 = "0.4.3"
futures = "0.3.31"
home = "0.5.9"
http = "1.1.0"
indicatif = { version = "0.17.8", features = ["improved_unicode"] }
indicatif = "0.17.8"
indoc = "2.0.5"
itertools = "0.13.0"
md5 = "0.7.0"
Expand Down
16 changes: 13 additions & 3 deletions src/languages/python/impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,19 @@ impl LanguageImpl for Python {

let uv = ensure_uv().await?;

// Set uv cache dir? tools dir? python dir?
let uv_cmd = |summary| {
#[allow(unused_mut)]
let mut cmd = Cmd::new(&uv, summary);
// Don't use cache in Windows, multiple uv instances will conflict with each other.
// See https://github.com/astral-sh/uv/issues/8664
#[cfg(windows)]
cmd.env("UV_NO_CACHE", "1");
cmd
};

// TODO: Set uv cache dir? tools dir? python dir?
// Create venv
Cmd::new(&uv, "create venv")
uv_cmd("create venv")
.arg("venv")
.arg(&venv)
.arg("--python")
Expand All @@ -41,7 +51,7 @@ impl LanguageImpl for Python {
patch_cfg_version_info(&venv).await?;

// Install dependencies
Cmd::new(&uv, "install dependencies")
uv_cmd("install dependencies")
.arg("pip")
.arg("install")
.arg(".")
Expand Down

0 comments on commit 548e9a1

Please sign in to comment.