Skip to content

Commit 087878c

Browse files
committed
Merge branch 'charlie/prio' into charlie/format
2 parents 0ad3066 + 963b78f commit 087878c

File tree

3 files changed

+58
-21
lines changed

3 files changed

+58
-21
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-resolver/src/pubgrub/report.rs

+15-20
Original file line numberDiff line numberDiff line change
@@ -1057,7 +1057,7 @@ impl std::fmt::Display for PubGrubHint {
10571057
Self::PrereleaseAvailable { package, version } => {
10581058
write!(
10591059
f,
1060-
"{}{} Pre-releases are available for {} in the requested range (e.g., {}), but pre-releases weren't enabled (try: `{}`)",
1060+
"{}{} Pre-releases are available for `{}` in the requested range (e.g., {}), but pre-releases weren't enabled (try: `{}`)",
10611061
"hint".bold().cyan(),
10621062
":".bold(),
10631063
package.bold(),
@@ -1068,7 +1068,7 @@ impl std::fmt::Display for PubGrubHint {
10681068
Self::PrereleaseRequested { package, range } => {
10691069
write!(
10701070
f,
1071-
"{}{} {} was requested with a pre-release marker (e.g., {}), but pre-releases weren't enabled (try: `{}`)",
1071+
"{}{} `{}` was requested with a pre-release marker (e.g., {}), but pre-releases weren't enabled (try: `{}`)",
10721072
"hint".bold().cyan(),
10731073
":".bold(),
10741074
package.bold(),
@@ -1096,7 +1096,7 @@ impl std::fmt::Display for PubGrubHint {
10961096
Self::MissingPackageMetadata { package } => {
10971097
write!(
10981098
f,
1099-
"{}{} Metadata for {} could not be found, as the wheel is missing a `METADATA` file",
1099+
"{}{} Metadata for `{}` could not be found, as the wheel is missing a `METADATA` file",
11001100
"hint".bold().cyan(),
11011101
":".bold(),
11021102
package.bold()
@@ -1105,7 +1105,7 @@ impl std::fmt::Display for PubGrubHint {
11051105
Self::InvalidPackageMetadata { package, reason } => {
11061106
write!(
11071107
f,
1108-
"{}{} Metadata for {} could not be parsed:\n{}",
1108+
"{}{} Metadata for `{}` could not be parsed:\n{}",
11091109
"hint".bold().cyan(),
11101110
":".bold(),
11111111
package.bold(),
@@ -1115,7 +1115,7 @@ impl std::fmt::Display for PubGrubHint {
11151115
Self::InvalidPackageStructure { package, reason } => {
11161116
write!(
11171117
f,
1118-
"{}{} The structure of {} was invalid:\n{}",
1118+
"{}{} The structure of `{}` was invalid:\n{}",
11191119
"hint".bold().cyan(),
11201120
":".bold(),
11211121
package.bold(),
@@ -1125,11 +1125,10 @@ impl std::fmt::Display for PubGrubHint {
11251125
Self::MissingVersionMetadata { package, version } => {
11261126
write!(
11271127
f,
1128-
"{}{} Metadata for {}=={} could not be found, as the wheel is missing a `METADATA` file",
1128+
"{}{} Metadata for `{}` could not be found, as the wheel is missing a `METADATA` file",
11291129
"hint".bold().cyan(),
11301130
":".bold(),
1131-
package.bold(),
1132-
version.bold(),
1131+
format!("{} v{}", package, version).bold(),
11331132
)
11341133
}
11351134
Self::InvalidVersionMetadata {
@@ -1139,11 +1138,10 @@ impl std::fmt::Display for PubGrubHint {
11391138
} => {
11401139
write!(
11411140
f,
1142-
"{}{} Metadata for {}=={} could not be parsed:\n{}",
1141+
"{}{} Metadata for `{}` could not be parsed:\n{}",
11431142
"hint".bold().cyan(),
11441143
":".bold(),
1145-
package.bold(),
1146-
version.bold(),
1144+
format!("{} v{}", package, version).bold(),
11471145
textwrap::indent(reason, " ")
11481146
)
11491147
}
@@ -1154,11 +1152,10 @@ impl std::fmt::Display for PubGrubHint {
11541152
} => {
11551153
write!(
11561154
f,
1157-
"{}{} The structure of {}=={} was invalid:\n{}",
1155+
"{}{} The structure of `{}` was invalid:\n{}",
11581156
"hint".bold().cyan(),
11591157
":".bold(),
1160-
package.bold(),
1161-
version.bold(),
1158+
format!("{} v{}", package, version).bold(),
11621159
textwrap::indent(reason, " ")
11631160
)
11641161
}
@@ -1169,11 +1166,10 @@ impl std::fmt::Display for PubGrubHint {
11691166
} => {
11701167
write!(
11711168
f,
1172-
"{}{} Metadata for {}=={} was inconsistent:\n{}",
1169+
"{}{} Metadata for `{}` was inconsistent:\n{}",
11731170
"hint".bold().cyan(),
11741171
":".bold(),
1175-
package.bold(),
1176-
version.bold(),
1172+
format!("{} v{}", package, version).bold(),
11771173
textwrap::indent(reason, " ")
11781174
)
11791175
}
@@ -1220,11 +1216,10 @@ impl std::fmt::Display for PubGrubHint {
12201216
} => {
12211217
write!(
12221218
f,
1223-
"{}{} The source distribution for {}=={} does not include static metadata. Generating metadata for this package requires Python {}, but Python {} is installed.",
1219+
"{}{} The source distribution for `{}` does not include static metadata. Generating metadata for this package requires Python {}, but Python {} is installed.",
12241220
"hint".bold().cyan(),
12251221
":".bold(),
1226-
package.bold(),
1227-
version.bold(),
1222+
format!("{} v{}", package, version).bold(),
12281223
requires_python.bold(),
12291224
python_version.bold(),
12301225
)

crates/uv/tests/it/pip_compile.rs

+42
Original file line numberDiff line numberDiff line change
@@ -13638,3 +13638,45 @@ fn compile_derivation_chain() -> Result<()> {
1363813638

1363913639
Ok(())
1364013640
}
13641+
13642+
/// See: <https://github.com/astral-sh/uv/issues/7553>
13643+
#[test]
13644+
fn invalid_platform() -> Result<()> {
13645+
let context = TestContext::new("3.10");
13646+
let requirements_in = context.temp_dir.child("requirements.in");
13647+
requirements_in.write_str("open3d")?;
13648+
13649+
uv_snapshot!(context
13650+
.pip_compile()
13651+
.arg("--python-platform")
13652+
.arg("linux")
13653+
.arg("requirements.in"), @r###"
13654+
success: false
13655+
exit_code: 1
13656+
----- stdout -----
13657+
13658+
----- stderr -----
13659+
× No solution found when resolving dependencies:
13660+
╰─▶ Because only the following versions of open3d are available:
13661+
open3d==0.8.0.0
13662+
open3d==0.9.0.0
13663+
open3d==0.10.0.0
13664+
open3d==0.10.0.1
13665+
open3d==0.11.0
13666+
open3d==0.11.1
13667+
open3d==0.11.2
13668+
open3d==0.12.0
13669+
open3d==0.13.0
13670+
open3d==0.14.1
13671+
open3d==0.15.1
13672+
open3d==0.15.2
13673+
open3d==0.16.0
13674+
open3d==0.16.1
13675+
open3d==0.17.0
13676+
open3d==0.18.0
13677+
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.
13678+
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.
13679+
"###);
13680+
13681+
Ok(())
13682+
}

0 commit comments

Comments
 (0)