diff --git a/crates/uv/tests/it/python_install.rs b/crates/uv/tests/it/python_install.rs index a8302e3e4..5cd76d8e8 100644 --- a/crates/uv/tests/it/python_install.rs +++ b/crates/uv/tests/it/python_install.rs @@ -2694,7 +2694,7 @@ fn python_install_no_cache() { "); } -#[cfg(target_os = "macos")] +#[cfg(all(target_os = "macos", target_arch = "aarch64"))] #[test] fn python_install_emulated_macos() { let context: TestContext = TestContext::new_with_versions(&[]) @@ -2702,6 +2702,20 @@ fn python_install_emulated_macos() { .with_managed_python_dirs() .with_python_download_cache(); + let arch_status = Command::new("/usr/bin/arch") + .arg("-x86_64") + .arg("true") + .status(); + if !arch_status.is_ok_and(|x| x.success()) { + // Rosetta is not available to run the x86_64 interpreter + // fail the test in CI, otherwise skip it + if env::var("CI").is_ok() { + panic!("x86_64 emulation is not available on this CI runner"); + } + debug!("Skipping test because x86_64 emulation is not available"); + return; + } + // Before installation, `uv python list` should not show the x86_64 download uv_snapshot!(context.filters(), context.python_list().arg("3.13"), @r" success: true