Skip to content

Commit 5d59cc7

Browse files
committed
Treat invalid platform as more compatible than invalid Python
1 parent df844e1 commit 5d59cc7

File tree

2 files changed

+43
-1
lines changed

2 files changed

+43
-1
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ impl IncompatibleWheel {
572572
},
573573
Self::Tag(tag_self) => match other {
574574
Self::ExcludeNewer(_) => false,
575-
Self::Tag(tag_other) => tag_other > tag_self,
575+
Self::Tag(tag_other) => tag_self > tag_other,
576576
Self::NoBinary | Self::RequiresPython(_, _) | Self::Yanked(_) => true,
577577
},
578578
Self::RequiresPython(_, _) => match other {

crates/uv/tests/it/pip_compile.rs

+42
Original file line numberDiff line numberDiff line change
@@ -13627,6 +13627,48 @@ fn compile_derivation_chain() -> Result<()> {
1362713627
Ok(())
1362813628
}
1362913629

13630+
/// See: <https://github.com/astral-sh/uv/issues/7553>
13631+
#[test]
13632+
fn invalid_platform() -> Result<()> {
13633+
let context = TestContext::new("3.10");
13634+
let requirements_in = context.temp_dir.child("requirements.in");
13635+
requirements_in.write_str("open3d")?;
13636+
13637+
uv_snapshot!(context
13638+
.pip_compile()
13639+
.arg("--python-platform")
13640+
.arg("linux")
13641+
.arg("requirements.in"), @r###"
13642+
success: false
13643+
exit_code: 1
13644+
----- stdout -----
13645+
13646+
----- stderr -----
13647+
× No solution found when resolving dependencies:
13648+
╰─▶ Because only the following versions of open3d are available:
13649+
open3d==0.8.0.0
13650+
open3d==0.9.0.0
13651+
open3d==0.10.0.0
13652+
open3d==0.10.0.1
13653+
open3d==0.11.0
13654+
open3d==0.11.1
13655+
open3d==0.11.2
13656+
open3d==0.12.0
13657+
open3d==0.13.0
13658+
open3d==0.14.1
13659+
open3d==0.15.1
13660+
open3d==0.15.2
13661+
open3d==0.16.0
13662+
open3d==0.16.1
13663+
open3d==0.17.0
13664+
open3d==0.18.0
13665+
and open3d<=0.15.2 has no wheels with a matching Python ABI tag, we can conclude that open3d<0.9.0.0 cannot be used.
13666+
And because open3d>=0.16.0 has no wheels with a matching platform tag and you require open3d, we can conclude that your requirements are unsatisfiable.
13667+
"###);
13668+
13669+
Ok(())
13670+
}
13671+
1363013672
/// Treat `sys_platform` and `sys.platform` as equivalent markers in the marker algebra.
1363113673
#[test]
1363213674
fn universal_disjoint_deprecated_markers() -> Result<()> {

0 commit comments

Comments
 (0)