diff --git a/tests/common/develop.rs b/tests/common/develop.rs index 97dd16788..edf44ad42 100644 --- a/tests/common/develop.rs +++ b/tests/common/develop.rs @@ -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{}", diff --git a/tests/run.rs b/tests/run.rs index af2c62c29..b2480989a 100644 --- a/tests/run.rs +++ b/tests/run.rs @@ -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, @@ -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,