mirror of
https://github.com/astral-sh/uv.git
synced 2025-11-03 05:03:46 +00:00
Add logging of incompatible tags on satisfies check (#15663)
Some checks are pending
CI / check system | python3.10 on windows x86 (push) Blocked by required conditions
CI / check system | python3.13 on windows x86-64 (push) Blocked by required conditions
CI / Determine changes (push) Waiting to run
CI / lint (push) Waiting to run
CI / integration test | github actions (push) Blocked by required conditions
CI / integration test | free-threaded python on github actions (push) Blocked by required conditions
CI / check cache | macos aarch64 (push) Blocked by required conditions
CI / check system | homebrew python on macos aarch64 (push) Blocked by required conditions
CI / check system | python on macos x86-64 (push) Blocked by required conditions
CI / check system | python3.10 on windows x86-64 (push) Blocked by required conditions
CI / check system | x86-64 python3.13 on windows aarch64 (push) Blocked by required conditions
CI / check system | aarch64 python3.13 on windows aarch64 (push) Blocked by required conditions
CI / check system | windows registry (push) Blocked by required conditions
CI / check system | python3.12 via chocolatey (push) Blocked by required conditions
CI / integration test | graalpy on windows (push) Blocked by required conditions
CI / smoke test | macos (push) Blocked by required conditions
CI / integration test | pypy on windows (push) Blocked by required conditions
CI / check system | conda3.8 on linux x86-64 (push) Blocked by required conditions
CI / check system | conda3.11 on windows x86-64 (push) Blocked by required conditions
CI / integration test | pyodide on ubuntu (push) Blocked by required conditions
CI / build binary | macos aarch64 (push) Blocked by required conditions
CI / cargo clippy | ubuntu (push) Blocked by required conditions
CI / cargo clippy | windows (push) Blocked by required conditions
CI / cargo test | ubuntu (push) Blocked by required conditions
CI / check windows trampoline | aarch64 (push) Blocked by required conditions
CI / check windows trampoline | i686 (push) Blocked by required conditions
CI / check windows trampoline | x86_64 (push) Blocked by required conditions
CI / test windows trampoline | aarch64 (push) Blocked by required conditions
CI / test windows trampoline | i686 (push) Blocked by required conditions
CI / test windows trampoline | x86_64 (push) Blocked by required conditions
CI / typos (push) Waiting to run
CI / mkdocs (push) Waiting to run
CI / build binary | linux libc (push) Blocked by required conditions
CI / build binary | linux aarch64 (push) Blocked by required conditions
CI / ecosystem test | pydantic/pydantic-core (push) Blocked by required conditions
CI / build binary | macos x86_64 (push) Blocked by required conditions
CI / build binary | windows x86_64 (push) Blocked by required conditions
CI / ecosystem test | prefecthq/prefect (push) Blocked by required conditions
CI / ecosystem test | pallets/flask (push) Blocked by required conditions
CI / smoke test | linux (push) Blocked by required conditions
CI / smoke test | linux aarch64 (push) Blocked by required conditions
CI / check system | alpine (push) Blocked by required conditions
CI / smoke test | windows x86_64 (push) Blocked by required conditions
CI / smoke test | windows aarch64 (push) Blocked by required conditions
CI / integration test | deadsnakes python3.9 on ubuntu (push) Blocked by required conditions
CI / integration test | graalpy on ubuntu (push) Blocked by required conditions
CI / check system | conda3.8 on windows x86-64 (push) Blocked by required conditions
CI / cargo dev generate-all (push) Blocked by required conditions
CI / cargo shear (push) Waiting to run
CI / cargo test | macos (push) Blocked by required conditions
CI / cargo test | windows (push) Blocked by required conditions
CI / build binary | linux musl (push) Blocked by required conditions
CI / build binary | windows aarch64 (push) Blocked by required conditions
CI / build binary | msrv (push) Blocked by required conditions
CI / build binary | freebsd (push) Blocked by required conditions
CI / integration test | conda on ubuntu (push) Blocked by required conditions
CI / integration test | free-threaded on windows (push) Blocked by required conditions
CI / integration test | aarch64 windows implicit (push) Blocked by required conditions
CI / integration test | aarch64 windows explicit (push) Blocked by required conditions
CI / integration test | pypy on ubuntu (push) Blocked by required conditions
CI / integration test | pyenv on wsl x86-64 (push) Blocked by required conditions
CI / integration test | determine publish changes (push) Blocked by required conditions
CI / integration test | registries (push) Blocked by required conditions
CI / integration test | uv publish (push) Blocked by required conditions
CI / integration test | uv_build (push) Blocked by required conditions
CI / check cache | ubuntu (push) Blocked by required conditions
CI / check system | python on debian (push) Blocked by required conditions
CI / check system | python on fedora (push) Blocked by required conditions
CI / check system | python on ubuntu (push) Blocked by required conditions
CI / check system | python on rocky linux 8 (push) Blocked by required conditions
CI / check system | python on macos aarch64 (push) Blocked by required conditions
CI / check system | python on rocky linux 9 (push) Blocked by required conditions
CI / check system | graalpy on ubuntu (push) Blocked by required conditions
CI / check system | pypy on ubuntu (push) Blocked by required conditions
CI / check system | pyston (push) Blocked by required conditions
CI / check system | python3.9 via pyenv (push) Blocked by required conditions
CI / check system | python3.13 (push) Blocked by required conditions
CI / check system | conda3.11 on macos aarch64 (push) Blocked by required conditions
CI / check system | conda3.8 on macos aarch64 (push) Blocked by required conditions
CI / check system | conda3.11 on linux x86-64 (push) Blocked by required conditions
CI / check system | amazonlinux (push) Blocked by required conditions
CI / check system | embedded python3.10 on windows x86-64 (push) Blocked by required conditions
CI / benchmarks | walltime aarch64 linux (push) Blocked by required conditions
CI / benchmarks | instrumented (push) Blocked by required conditions
zizmor / Run zizmor (push) Waiting to run
Some checks are pending
CI / check system | python3.10 on windows x86 (push) Blocked by required conditions
CI / check system | python3.13 on windows x86-64 (push) Blocked by required conditions
CI / Determine changes (push) Waiting to run
CI / lint (push) Waiting to run
CI / integration test | github actions (push) Blocked by required conditions
CI / integration test | free-threaded python on github actions (push) Blocked by required conditions
CI / check cache | macos aarch64 (push) Blocked by required conditions
CI / check system | homebrew python on macos aarch64 (push) Blocked by required conditions
CI / check system | python on macos x86-64 (push) Blocked by required conditions
CI / check system | python3.10 on windows x86-64 (push) Blocked by required conditions
CI / check system | x86-64 python3.13 on windows aarch64 (push) Blocked by required conditions
CI / check system | aarch64 python3.13 on windows aarch64 (push) Blocked by required conditions
CI / check system | windows registry (push) Blocked by required conditions
CI / check system | python3.12 via chocolatey (push) Blocked by required conditions
CI / integration test | graalpy on windows (push) Blocked by required conditions
CI / smoke test | macos (push) Blocked by required conditions
CI / integration test | pypy on windows (push) Blocked by required conditions
CI / check system | conda3.8 on linux x86-64 (push) Blocked by required conditions
CI / check system | conda3.11 on windows x86-64 (push) Blocked by required conditions
CI / integration test | pyodide on ubuntu (push) Blocked by required conditions
CI / build binary | macos aarch64 (push) Blocked by required conditions
CI / cargo clippy | ubuntu (push) Blocked by required conditions
CI / cargo clippy | windows (push) Blocked by required conditions
CI / cargo test | ubuntu (push) Blocked by required conditions
CI / check windows trampoline | aarch64 (push) Blocked by required conditions
CI / check windows trampoline | i686 (push) Blocked by required conditions
CI / check windows trampoline | x86_64 (push) Blocked by required conditions
CI / test windows trampoline | aarch64 (push) Blocked by required conditions
CI / test windows trampoline | i686 (push) Blocked by required conditions
CI / test windows trampoline | x86_64 (push) Blocked by required conditions
CI / typos (push) Waiting to run
CI / mkdocs (push) Waiting to run
CI / build binary | linux libc (push) Blocked by required conditions
CI / build binary | linux aarch64 (push) Blocked by required conditions
CI / ecosystem test | pydantic/pydantic-core (push) Blocked by required conditions
CI / build binary | macos x86_64 (push) Blocked by required conditions
CI / build binary | windows x86_64 (push) Blocked by required conditions
CI / ecosystem test | prefecthq/prefect (push) Blocked by required conditions
CI / ecosystem test | pallets/flask (push) Blocked by required conditions
CI / smoke test | linux (push) Blocked by required conditions
CI / smoke test | linux aarch64 (push) Blocked by required conditions
CI / check system | alpine (push) Blocked by required conditions
CI / smoke test | windows x86_64 (push) Blocked by required conditions
CI / smoke test | windows aarch64 (push) Blocked by required conditions
CI / integration test | deadsnakes python3.9 on ubuntu (push) Blocked by required conditions
CI / integration test | graalpy on ubuntu (push) Blocked by required conditions
CI / check system | conda3.8 on windows x86-64 (push) Blocked by required conditions
CI / cargo dev generate-all (push) Blocked by required conditions
CI / cargo shear (push) Waiting to run
CI / cargo test | macos (push) Blocked by required conditions
CI / cargo test | windows (push) Blocked by required conditions
CI / build binary | linux musl (push) Blocked by required conditions
CI / build binary | windows aarch64 (push) Blocked by required conditions
CI / build binary | msrv (push) Blocked by required conditions
CI / build binary | freebsd (push) Blocked by required conditions
CI / integration test | conda on ubuntu (push) Blocked by required conditions
CI / integration test | free-threaded on windows (push) Blocked by required conditions
CI / integration test | aarch64 windows implicit (push) Blocked by required conditions
CI / integration test | aarch64 windows explicit (push) Blocked by required conditions
CI / integration test | pypy on ubuntu (push) Blocked by required conditions
CI / integration test | pyenv on wsl x86-64 (push) Blocked by required conditions
CI / integration test | determine publish changes (push) Blocked by required conditions
CI / integration test | registries (push) Blocked by required conditions
CI / integration test | uv publish (push) Blocked by required conditions
CI / integration test | uv_build (push) Blocked by required conditions
CI / check cache | ubuntu (push) Blocked by required conditions
CI / check system | python on debian (push) Blocked by required conditions
CI / check system | python on fedora (push) Blocked by required conditions
CI / check system | python on ubuntu (push) Blocked by required conditions
CI / check system | python on rocky linux 8 (push) Blocked by required conditions
CI / check system | python on macos aarch64 (push) Blocked by required conditions
CI / check system | python on rocky linux 9 (push) Blocked by required conditions
CI / check system | graalpy on ubuntu (push) Blocked by required conditions
CI / check system | pypy on ubuntu (push) Blocked by required conditions
CI / check system | pyston (push) Blocked by required conditions
CI / check system | python3.9 via pyenv (push) Blocked by required conditions
CI / check system | python3.13 (push) Blocked by required conditions
CI / check system | conda3.11 on macos aarch64 (push) Blocked by required conditions
CI / check system | conda3.8 on macos aarch64 (push) Blocked by required conditions
CI / check system | conda3.11 on linux x86-64 (push) Blocked by required conditions
CI / check system | amazonlinux (push) Blocked by required conditions
CI / check system | embedded python3.10 on windows x86-64 (push) Blocked by required conditions
CI / benchmarks | walltime aarch64 linux (push) Blocked by required conditions
CI / benchmarks | instrumented (push) Blocked by required conditions
zizmor / Run zizmor (push) Waiting to run
I was trying to understand https://github.com/astral-sh/uv/issues/9559 and think we need more logs to see what's going on.
This commit is contained in:
parent
d178e45368
commit
50bfa8a689
2 changed files with 154 additions and 3 deletions
|
|
@ -5,7 +5,7 @@ use thiserror::Error;
|
|||
|
||||
use uv_platform_tags::{
|
||||
AbiTag, LanguageTag, ParseAbiTagError, ParseLanguageTagError, ParsePlatformTagError,
|
||||
PlatformTag, Tags,
|
||||
PlatformTag, TagCompatibility, Tags,
|
||||
};
|
||||
|
||||
use crate::splitter::MemchrSplitter;
|
||||
|
|
@ -39,6 +39,30 @@ impl ExpandedTags {
|
|||
compatible_tags.is_compatible(tag.python_tags(), tag.abi_tags(), tag.platform_tags())
|
||||
})
|
||||
}
|
||||
|
||||
/// Return the Python tags in this expanded tag set.
|
||||
pub fn python_tags(&self) -> impl Iterator<Item = &LanguageTag> {
|
||||
self.0.iter().flat_map(WheelTag::python_tags)
|
||||
}
|
||||
|
||||
/// Return the ABI tags in this expanded tag set.
|
||||
pub fn abi_tags(&self) -> impl Iterator<Item = &AbiTag> {
|
||||
self.0.iter().flat_map(WheelTag::abi_tags)
|
||||
}
|
||||
|
||||
/// Return the platform tags in this expanded tag set.
|
||||
pub fn platform_tags(&self) -> impl Iterator<Item = &PlatformTag> {
|
||||
self.0.iter().flat_map(WheelTag::platform_tags)
|
||||
}
|
||||
|
||||
/// Return the [`TagCompatibility`] of the wheel with the given tags
|
||||
pub fn compatibility(&self, compatible_tags: &Tags) -> TagCompatibility {
|
||||
compatible_tags.compatibility(
|
||||
self.python_tags().copied().collect::<Vec<_>>().as_slice(),
|
||||
self.abi_tags().copied().collect::<Vec<_>>().as_slice(),
|
||||
self.platform_tags().cloned().collect::<Vec<_>>().as_slice(),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Error, Debug)]
|
||||
|
|
|
|||
|
|
@ -1,12 +1,14 @@
|
|||
use std::borrow::Cow;
|
||||
use std::fmt::Debug;
|
||||
|
||||
use owo_colors::OwoColorize;
|
||||
use same_file::is_same_file;
|
||||
use tracing::{debug, trace};
|
||||
use url::Url;
|
||||
|
||||
use uv_cache_info::CacheInfo;
|
||||
use uv_cache_key::{CanonicalUrl, RepositoryUrl};
|
||||
use uv_distribution_filename::ExpandedTags;
|
||||
use uv_distribution_types::{
|
||||
BuildInfo, BuildVariables, ConfigSettings, ExtraBuildRequirement, ExtraBuildRequires,
|
||||
ExtraBuildVariables, InstalledDirectUrlDist, InstalledDist, InstalledDistKind,
|
||||
|
|
@ -14,7 +16,7 @@ use uv_distribution_types::{
|
|||
};
|
||||
use uv_git_types::GitOid;
|
||||
use uv_normalize::PackageName;
|
||||
use uv_platform_tags::Tags;
|
||||
use uv_platform_tags::{IncompatibleTag, TagCompatibility, Tags};
|
||||
use uv_pypi_types::{DirInfo, DirectUrl, VcsInfo, VcsKind};
|
||||
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
|
|
@ -314,7 +316,11 @@ impl RequirementSatisfaction {
|
|||
// If the distribution isn't compatible with the current platform, it is a mismatch.
|
||||
if let Ok(Some(wheel_tags)) = distribution.read_tags() {
|
||||
if !wheel_tags.is_compatible(tags) {
|
||||
debug!("Platform tags mismatch for {name}: {distribution}");
|
||||
if let Some(hint) = generate_dist_compatibility_hint(wheel_tags, tags) {
|
||||
debug!("Platform tags mismatch for {distribution}: {hint}");
|
||||
} else {
|
||||
debug!("Platform tags mismatch for {distribution}");
|
||||
}
|
||||
return Self::Mismatch;
|
||||
}
|
||||
}
|
||||
|
|
@ -355,3 +361,124 @@ fn extra_build_variables_for<'settings>(
|
|||
) -> Option<&'settings BuildVariables> {
|
||||
extra_build_variables.get(name)
|
||||
}
|
||||
|
||||
/// Generate a hint for explaining tag compatibility issues.
|
||||
// TODO(zanieb): We should refactor this to share logic with `generate_wheel_compatibility_hint`
|
||||
fn generate_dist_compatibility_hint(wheel_tags: &ExpandedTags, tags: &Tags) -> Option<String> {
|
||||
let TagCompatibility::Incompatible(incompatible_tag) = wheel_tags.compatibility(tags) else {
|
||||
return None;
|
||||
};
|
||||
|
||||
match incompatible_tag {
|
||||
IncompatibleTag::Python => {
|
||||
let wheel_tags = wheel_tags.python_tags();
|
||||
let current_tag = tags.python_tag();
|
||||
|
||||
if let Some(current) = current_tag {
|
||||
let message = if let Some(pretty) = current.pretty() {
|
||||
format!("{} (`{}`)", pretty.cyan(), current.cyan())
|
||||
} else {
|
||||
format!("`{}`", current.cyan())
|
||||
};
|
||||
|
||||
Some(format!(
|
||||
"The distribution is compatible with {}, but you're using {}",
|
||||
wheel_tags
|
||||
.map(|tag| if let Some(pretty) = tag.pretty() {
|
||||
format!("{} (`{}`)", pretty.cyan(), tag.cyan())
|
||||
} else {
|
||||
format!("`{}`", tag.cyan())
|
||||
})
|
||||
.collect::<Vec<_>>()
|
||||
.join(", "),
|
||||
message
|
||||
))
|
||||
} else {
|
||||
Some(format!(
|
||||
"The distribution requires {}",
|
||||
wheel_tags
|
||||
.map(|tag| if let Some(pretty) = tag.pretty() {
|
||||
format!("{} (`{}`)", pretty.cyan(), tag.cyan())
|
||||
} else {
|
||||
format!("`{}`", tag.cyan())
|
||||
})
|
||||
.collect::<Vec<_>>()
|
||||
.join(", ")
|
||||
))
|
||||
}
|
||||
}
|
||||
IncompatibleTag::Abi => {
|
||||
let wheel_tags = wheel_tags.abi_tags();
|
||||
let current_tag = tags.abi_tag();
|
||||
|
||||
if let Some(current) = current_tag {
|
||||
let message = if let Some(pretty) = current.pretty() {
|
||||
format!("{} (`{}`)", pretty.cyan(), current.cyan())
|
||||
} else {
|
||||
format!("`{}`", current.cyan())
|
||||
};
|
||||
Some(format!(
|
||||
"The distribution is compatible with {}, but you're using {}",
|
||||
wheel_tags
|
||||
.map(|tag| if let Some(pretty) = tag.pretty() {
|
||||
format!("{} (`{}`)", pretty.cyan(), tag.cyan())
|
||||
} else {
|
||||
format!("`{}`", tag.cyan())
|
||||
})
|
||||
.collect::<Vec<_>>()
|
||||
.join(", "),
|
||||
message
|
||||
))
|
||||
} else {
|
||||
Some(format!(
|
||||
"The distribution requires {}",
|
||||
wheel_tags
|
||||
.map(|tag| if let Some(pretty) = tag.pretty() {
|
||||
format!("{} (`{}`)", pretty.cyan(), tag.cyan())
|
||||
} else {
|
||||
format!("`{}`", tag.cyan())
|
||||
})
|
||||
.collect::<Vec<_>>()
|
||||
.join(", ")
|
||||
))
|
||||
}
|
||||
}
|
||||
IncompatibleTag::Platform => {
|
||||
let wheel_tags = wheel_tags.platform_tags();
|
||||
let current_tag = tags.platform_tag();
|
||||
|
||||
if let Some(current) = current_tag {
|
||||
let message = if let Some(pretty) = current.pretty() {
|
||||
format!("{} (`{}`)", pretty.cyan(), current.cyan())
|
||||
} else {
|
||||
format!("`{}`", current.cyan())
|
||||
};
|
||||
Some(format!(
|
||||
"The distribution is compatible with {}, but you're on {}",
|
||||
wheel_tags
|
||||
.map(|tag| if let Some(pretty) = tag.pretty() {
|
||||
format!("{} (`{}`)", pretty.cyan(), tag.cyan())
|
||||
} else {
|
||||
format!("`{}`", tag.cyan())
|
||||
})
|
||||
.collect::<Vec<_>>()
|
||||
.join(", "),
|
||||
message
|
||||
))
|
||||
} else {
|
||||
Some(format!(
|
||||
"The distribution requires {}",
|
||||
wheel_tags
|
||||
.map(|tag| if let Some(pretty) = tag.pretty() {
|
||||
format!("{} (`{}`)", pretty.cyan(), tag.cyan())
|
||||
} else {
|
||||
format!("`{}`", tag.cyan())
|
||||
})
|
||||
.collect::<Vec<_>>()
|
||||
.join(", ")
|
||||
))
|
||||
}
|
||||
}
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue