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

Include uppercase platforms for Windows wheels #11681

Merged
merged 1 commit into from
Feb 20, 2025
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
5 changes: 2 additions & 3 deletions crates/uv-resolver/src/lock/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,13 @@ static MAC_MARKERS: LazyLock<UniversalMarker> = LazyLock::new(|| {
});
static ARM_MARKERS: LazyLock<UniversalMarker> = LazyLock::new(|| {
let pep508 =
MarkerTree::from_str("platform_machine == 'aarch64' or platform_machine == 'arm64'")
MarkerTree::from_str("platform_machine == 'aarch64' or platform_machine == 'arm64' or platform_machine == 'ARM64'")
.unwrap();
UniversalMarker::new(pep508, ConflictMarker::TRUE)
});
static X86_64_MARKERS: LazyLock<UniversalMarker> = LazyLock::new(|| {
let pep508 =
MarkerTree::from_str("platform_machine == 'x86_64' or platform_machine == 'amd64'")
MarkerTree::from_str("platform_machine == 'x86_64' or platform_machine == 'amd64' or platform_machine == 'AMD64'")
.unwrap();
UniversalMarker::new(pep508, ConflictMarker::TRUE)
});
Expand Down Expand Up @@ -326,7 +326,6 @@ impl Lock {
}

if platform_tags.iter().all(PlatformTag::is_windows) {
// TODO(charlie): This omits `win_ia64`, which is accepted by Warehouse.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is stale, but not relevant to this PR specifically. Sneaking it in.

if graph.graph[node_index]
.marker()
.is_disjoint(*WINDOWS_MARKERS)
Expand Down
77 changes: 77 additions & 0 deletions crates/uv/tests/it/lock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25553,3 +25553,80 @@ fn lock_pytorch_local_preference() -> Result<()> {

Ok(())
}

#[test]
fn windows_arm() -> Result<()> {
let context = TestContext::new("3.12").with_exclude_newer("2025-01-30T00:00:00Z");

let pyproject_toml = context.temp_dir.child("pyproject.toml");
pyproject_toml.write_str(
r#"
[project]
name = "pywin32-prj"
version = "0.1.0"
requires-python = "~=3.12.0"
dependencies = ["pywin32; sys_platform == 'win32'"]

[tool.uv]
environments = [
"sys_platform == 'linux' and platform_machine == 'x86_64'",
"sys_platform == 'win32' and platform_machine == 'AMD64'",
]
"#,
)?;

uv_snapshot!(context.filters(), context.lock(), @r###"
success: true
exit_code: 0
----- stdout -----

----- stderr -----
Resolved 2 packages in [TIME]
"###);

let lock = context.read("uv.lock");

insta::with_settings!({
filters => context.filters(),
}, {
assert_snapshot!(
lock, @r###"
version = 1
revision = 1
requires-python = ">=3.12.[X], <3.13"
resolution-markers = [
"platform_machine == 'x86_64' and sys_platform == 'linux'",
"platform_machine == 'AMD64' and sys_platform == 'win32'",
]
supported-markers = [
"platform_machine == 'x86_64' and sys_platform == 'linux'",
"platform_machine == 'AMD64' and sys_platform == 'win32'",
]

[options]
exclude-newer = "2025-01-30T00:00:00Z"

[[package]]
name = "pywin32"
version = "308"
source = { registry = "https://pypi.org/simple" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/21/27/0c8811fbc3ca188f93b5354e7c286eb91f80a53afa4e11007ef661afa746/pywin32-308-cp312-cp312-win_amd64.whl", hash = "sha256:00b3e11ef09ede56c6a43c71f2d31857cf7c54b0ab6e78ac659497abd2834f47", size = 6543015 },
]

[[package]]
name = "pywin32-prj"
version = "0.1.0"
source = { virtual = "." }
dependencies = [
{ name = "pywin32", marker = "platform_machine == 'AMD64' and sys_platform == 'win32'" },
]

[package.metadata]
requires-dist = [{ name = "pywin32", marker = "sys_platform == 'win32'" }]
"###
);
});

Ok(())
}
Loading