Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use uv venv in tests #2087

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ jobs:
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
- name: Sccache Setup
- name: sccache Setup
uses: mozilla-actions/[email protected]
with:
version: "v0.7.6"
Expand All @@ -136,7 +136,7 @@ jobs:
if: ${{ !contains(matrix.platform.python-version, 'pypy') }}
run: pip install cffi
- name: Install python packages
run: pip install virtualenv ziglang~=0.10.0 twine uniffi-bindgen==0.27.0
run: pip install uv virtualenv ziglang~=0.10.0 twine uniffi-bindgen==0.27.0
- uses: dtolnay/rust-toolchain@stable
id: rustup
with:
Expand Down
10 changes: 9 additions & 1 deletion tests/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,15 @@ pub fn create_virtualenv(name: &str, python_interp: Option<PathBuf>) -> Result<(
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
Loading