Skip to content

Commit

Permalink
Use uv venv in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
messense committed Dec 8, 2024
1 parent 92d7dce commit a166f74
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
10 changes: 9 additions & 1 deletion tests/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,15 @@ pub fn create_named_virtualenv(venv_name: &str, interp: Option<PathBuf>) -> 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);
}
Expand Down

0 comments on commit a166f74

Please sign in to comment.