Skip to content

Commit f122387

Browse files
authored
Fix implied platform_machine marker for win_arm64 platform tag (#15921)
<!-- Thank you for contributing to uv! To help us out with reviewing, please consider the following: - Does this pull request include a summary of the change? (See below.) - Does this pull request include a descriptive title? - Does this pull request include references to any relevant issues? --> ## Summary I'm back again after #14041, this time for `win_arm64`. I [asked a Windows on ARM user](getlogbook/logbook#451 (comment)) what the value of `platform.machine()` is, and it's `ARM64`. ## Test Plan Updated/added tests
1 parent c4c4781 commit f122387

File tree

2 files changed

+79
-2
lines changed

2 files changed

+79
-2
lines changed

crates/uv-distribution-types/src/prioritized_distribution.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -860,7 +860,7 @@ fn implied_platform_markers(filename: &WheelFilename) -> MarkerTree {
860860
tag_marker.and(MarkerTree::expression(MarkerExpression::String {
861861
key: MarkerValueString::PlatformMachine,
862862
operator: MarkerOperator::Equal,
863-
value: arcstr::literal!("arm64"),
863+
value: arcstr::literal!("ARM64"),
864864
}));
865865
marker.or(tag_marker);
866866
}
@@ -1051,7 +1051,7 @@ mod tests {
10511051
);
10521052
assert_platform_markers(
10531053
"numpy-2.2.1-cp313-cp313t-win_arm64.whl",
1054-
"sys_platform == 'win32' and platform_machine == 'arm64'",
1054+
"sys_platform == 'win32' and platform_machine == 'ARM64'",
10551055
);
10561056
assert_platform_markers(
10571057
"numpy-2.2.1-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
@@ -1128,6 +1128,10 @@ mod tests {
11281128
"numpy-1.0-cp310-cp310-win32.whl",
11291129
"python_full_version == '3.10.*' and platform_python_implementation == 'CPython' and sys_platform == 'win32' and platform_machine == 'x86'",
11301130
);
1131+
assert_implied_markers(
1132+
"pywin32-311-cp314-cp314-win_arm64.whl",
1133+
"python_full_version == '3.14.*' and platform_python_implementation == 'CPython' and sys_platform == 'win32' and platform_machine == 'ARM64'",
1134+
);
11311135
assert_implied_markers(
11321136
"numpy-1.0-cp311-cp311-macosx_10_9_x86_64.whl",
11331137
"python_full_version == '3.11.*' and platform_python_implementation == 'CPython' and sys_platform == 'darwin' and platform_machine == 'x86_64'",

crates/uv/tests/it/lock.rs

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29504,6 +29504,79 @@ fn windows_amd64_required() -> Result<()> {
2950429504
Ok(())
2950529505
}
2950629506

29507+
#[test]
29508+
fn windows_arm64_required() -> Result<()> {
29509+
let context = TestContext::new("3.12").with_exclude_newer("2025-01-30T00:00:00Z");
29510+
29511+
let pyproject_toml = context.temp_dir.child("pyproject.toml");
29512+
pyproject_toml.write_str(
29513+
r#"
29514+
[project]
29515+
name = "pywin32-prj"
29516+
version = "0.1.0"
29517+
requires-python = "~=3.12.0"
29518+
dependencies = ["pywin32; sys_platform == 'win32'"]
29519+
29520+
[tool.uv]
29521+
required-environments = [
29522+
"sys_platform == 'win32' and platform_machine == 'ARM64'",
29523+
]
29524+
"#,
29525+
)?;
29526+
29527+
uv_snapshot!(context.filters(), context.lock(), @r###"
29528+
success: true
29529+
exit_code: 0
29530+
----- stdout -----
29531+
29532+
----- stderr -----
29533+
Resolved 2 packages in [TIME]
29534+
"###);
29535+
29536+
let lock = context.read("uv.lock");
29537+
29538+
insta::with_settings!({
29539+
filters => context.filters(),
29540+
}, {
29541+
assert_snapshot!(
29542+
lock, @r#"
29543+
version = 1
29544+
revision = 3
29545+
requires-python = "==3.12.*"
29546+
required-markers = [
29547+
"platform_machine == 'ARM64' and sys_platform == 'win32'",
29548+
]
29549+
29550+
[options]
29551+
exclude-newer = "2025-01-30T00:00:00Z"
29552+
29553+
[[package]]
29554+
name = "pywin32"
29555+
version = "308"
29556+
source = { registry = "https://pypi.org/simple" }
29557+
wheels = [
29558+
{ url = "https://files.pythonhosted.org/packages/00/7c/d00d6bdd96de4344e06c4afbf218bc86b54436a94c01c71a8701f613aa56/pywin32-308-cp312-cp312-win32.whl", hash = "sha256:587f3e19696f4bf96fde9d8a57cec74a57021ad5f204c9e627e15c33ff568897", size = 5939729, upload-time = "2024-10-12T20:42:12.001Z" },
29559+
{ url = "https://files.pythonhosted.org/packages/21/27/0c8811fbc3ca188f93b5354e7c286eb91f80a53afa4e11007ef661afa746/pywin32-308-cp312-cp312-win_amd64.whl", hash = "sha256:00b3e11ef09ede56c6a43c71f2d31857cf7c54b0ab6e78ac659497abd2834f47", size = 6543015, upload-time = "2024-10-12T20:42:14.044Z" },
29560+
{ url = "https://files.pythonhosted.org/packages/9d/0f/d40f8373608caed2255781a3ad9a51d03a594a1248cd632d6a298daca693/pywin32-308-cp312-cp312-win_arm64.whl", hash = "sha256:9b4de86c8d909aed15b7011182c8cab38c8850de36e6afb1f0db22b8959e3091", size = 7976033, upload-time = "2024-10-12T20:42:16.215Z" },
29561+
]
29562+
29563+
[[package]]
29564+
name = "pywin32-prj"
29565+
version = "0.1.0"
29566+
source = { virtual = "." }
29567+
dependencies = [
29568+
{ name = "pywin32", marker = "sys_platform == 'win32'" },
29569+
]
29570+
29571+
[package.metadata]
29572+
requires-dist = [{ name = "pywin32", marker = "sys_platform == 'win32'" }]
29573+
"#
29574+
);
29575+
});
29576+
29577+
Ok(())
29578+
}
29579+
2950729580
#[test]
2950829581
fn lock_empty_extra() -> Result<()> {
2950929582
let context = TestContext::new("3.12");

0 commit comments

Comments
 (0)