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

Only run uv tests on platforms that has wheel on PyPI or when uv bina… #2037

Merged
merged 1 commit into from
Apr 10, 2024
Merged
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
26 changes: 16 additions & 10 deletions tests/common/develop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,22 @@ pub fn test_develop(
// Ensure the test doesn't wrongly pass
check_installed(package, &python).unwrap_err();

let output = Command::new(&python)
.args([
"-m",
"pip",
"install",
"--disable-pip-version-check",
"uv",
"cffi",
])
.output()?;
let mut cmd = Command::new(&python);
cmd.args([
"-m",
"pip",
"install",
"--disable-pip-version-check",
"cffi",
]);
if cfg!(any(
target_os = "linux",
target_os = "macos",
target_os = "windows"
)) {
cmd.arg("uv");
}
let output = cmd.output()?;
if !output.status.success() {
panic!(
"Failed to install cffi: {}\n---stdout:\n{}---stderr:\n{}",
Expand Down
24 changes: 24 additions & 0 deletions tests/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,18 @@ fn develop_uniffi_mixed() {
#[case(TestInstallBackend::Uv, "uv")]
#[test]
fn develop_hello_world(#[case] backend: TestInstallBackend, #[case] name: &str) {
// Only run uv tests on platforms that has wheel on PyPI or when uv binary is found
if matches!(backend, TestInstallBackend::Uv)
&& !cfg!(any(
target_os = "linux",
target_os = "macos",
target_os = "windows"
))
&& which("uv").is_err()
{
return;
}

handle_result(develop::test_develop(
"test-crates/hello-world",
None,
Expand All @@ -205,6 +217,18 @@ fn develop_hello_world(#[case] backend: TestInstallBackend, #[case] name: &str)
#[case(TestInstallBackend::Uv, "uv")]
#[test]
fn develop_pyo3_ffi_pure(#[case] backend: TestInstallBackend, #[case] name: &str) {
// Only run uv tests on platforms that has wheel on PyPI or when uv binary is found
if matches!(backend, TestInstallBackend::Uv)
&& !cfg!(any(
target_os = "linux",
target_os = "macos",
target_os = "windows"
))
&& which("uv").is_err()
{
return;
}

handle_result(develop::test_develop(
"test-crates/pyo3-ffi-pure",
None,
Expand Down