From a166f740f2d971cb7de7965af5397b25949ac34f Mon Sep 17 00:00:00 2001 From: messense Date: Wed, 15 May 2024 10:21:14 +0800 Subject: [PATCH] Use `uv venv` in tests --- .github/workflows/test.yml | 2 +- tests/common/mod.rs | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 13a0428ac..6c7ff7d73 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -72,7 +72,7 @@ jobs: run: | sudo rm -rf /usr/share/dotnet sudo rm -rf /opt/ghc - - name: Sccache Setup + - name: sccache Setup uses: mozilla-actions/sccache-action@v0.0.6 with: version: "v0.7.6" diff --git a/tests/common/mod.rs b/tests/common/mod.rs index 55aa65c89..ea051794c 100644 --- a/tests/common/mod.rs +++ b/tests/common/mod.rs @@ -144,7 +144,15 @@ pub fn create_named_virtualenv(venv_name: &str, interp: Option) -> Resu fs::remove_dir_all(&venv_dir)?; } - let mut cmd = Command::new("virtualenv"); + let mut cmd = { + if let Ok(uv) = which::which("uv") { + let mut cmd = Command::new(uv); + cmd.args(["venv", "--seed"]); + cmd + } else { + Command::new("virtualenv") + } + }; if let Some(interp) = interp { cmd.arg("-p").arg(interp); }