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

Use a dedicated message for incompatible Python versions in wheel ABI tags #8363

Merged
merged 1 commit into from
Oct 20, 2024
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
3 changes: 3 additions & 0 deletions crates/uv-distribution-types/src/prioritized_distribution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ impl Display for IncompatibleDist {
f.write_str("no wheels with a matching Python implementation tag")
}
IncompatibleTag::Abi => f.write_str("no wheels with a matching Python ABI tag"),
IncompatibleTag::AbiPythonVersion => {
f.write_str("no wheels with a matching Python version tag")
}
IncompatibleTag::Platform => {
f.write_str("no wheels with a matching platform tag")
}
Expand Down
6 changes: 6 additions & 0 deletions crates/uv-platform-tags/src/tags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,15 @@ pub enum TagsError {

#[derive(Debug, Eq, Ord, PartialEq, PartialOrd, Clone)]
pub enum IncompatibleTag {
/// The tag is invalid and cannot be used.
Invalid,
/// The Python implementation tag is incompatible.
Python,
/// The ABI tag is incompatible.
Abi,
/// The Python version component of the ABI tag is incompatible with `requires-python`.
AbiPythonVersion,
/// The platform tag is incompatible.
Platform,
}

Expand Down
4 changes: 3 additions & 1 deletion crates/uv-resolver/src/version_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,9 @@ impl VersionMapLazy {
// Check if the wheel is compatible with the `requires-python` (i.e., the Python ABI tag
// is not less than the `requires-python` minimum version).
if !self.requires_python.matches_wheel_tag(filename) {
return WheelCompatibility::Incompatible(IncompatibleWheel::Tag(IncompatibleTag::Abi));
return WheelCompatibility::Incompatible(IncompatibleWheel::Tag(
IncompatibleTag::AbiPythonVersion,
));
}

// Break ties with the build tag.
Expand Down
2 changes: 1 addition & 1 deletion crates/uv/tests/it/lock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5521,7 +5521,7 @@ fn lock_requires_python_no_wheels() -> Result<()> {

----- stderr -----
× No solution found when resolving dependencies:
╰─▶ Because dearpygui==1.9.1 has no wheels with a matching Python ABI tag and your project depends on dearpygui==1.9.1, we can conclude that your project's requirements are unsatisfiable.
╰─▶ Because dearpygui==1.9.1 has no wheels with a matching Python version tag and your project depends on dearpygui==1.9.1, we can conclude that your project's requirements are unsatisfiable.
"###);

Ok(())
Expand Down
Loading