mirror of
https://github.com/astral-sh/uv.git
synced 2025-11-23 04:55:28 +00:00
Skip python_install_emulated_macos except on ARM64 macos with rosetta (#16687)
## Summary This test isn't useful on non-arm64 macs, and it outright fails if rosetta isn't installed. ## Test Plan Run it on my rosetta-stripped macbook
This commit is contained in:
parent
1b38b47a3f
commit
2de987ed37
1 changed files with 15 additions and 1 deletions
|
|
@ -2694,7 +2694,7 @@ fn python_install_no_cache() {
|
||||||
");
|
");
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(all(target_os = "macos", target_arch = "aarch64"))]
|
||||||
#[test]
|
#[test]
|
||||||
fn python_install_emulated_macos() {
|
fn python_install_emulated_macos() {
|
||||||
let context: TestContext = TestContext::new_with_versions(&[])
|
let context: TestContext = TestContext::new_with_versions(&[])
|
||||||
|
|
@ -2702,6 +2702,20 @@ fn python_install_emulated_macos() {
|
||||||
.with_managed_python_dirs()
|
.with_managed_python_dirs()
|
||||||
.with_python_download_cache();
|
.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
|
// Before installation, `uv python list` should not show the x86_64 download
|
||||||
uv_snapshot!(context.filters(), context.python_list().arg("3.13"), @r"
|
uv_snapshot!(context.filters(), context.python_list().arg("3.13"), @r"
|
||||||
success: true
|
success: true
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue