mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 10:58:28 +00:00
Use short-form for platform tag checks (#10737)
This commit is contained in:
parent
1bfa7230fc
commit
3fe4e7168b
1 changed files with 7 additions and 25 deletions
|
@ -32,7 +32,7 @@ use uv_git::{GitReference, GitSha, RepositoryReference, ResolvedRepositoryRefere
|
|||
use uv_normalize::{ExtraName, GroupName, PackageName};
|
||||
use uv_pep440::Version;
|
||||
use uv_pep508::{split_scheme, MarkerEnvironment, MarkerTree, VerbatimUrl, VerbatimUrlError};
|
||||
use uv_platform_tags::{TagCompatibility, TagPriority, Tags};
|
||||
use uv_platform_tags::{PlatformTag, TagCompatibility, TagPriority, Tags};
|
||||
use uv_pypi_types::{
|
||||
redact_credentials, ConflictPackage, Conflicts, HashDigest, ParsedArchiveUrl, ParsedGitUrl,
|
||||
Requirement, RequirementSource,
|
||||
|
@ -292,19 +292,13 @@ impl Lock {
|
|||
// a single disjointness check with the intersection is sufficient, so we have one
|
||||
// constant per platform.
|
||||
let platform_tags = wheel.filename.platform_tags();
|
||||
if platform_tags
|
||||
.iter()
|
||||
.all(uv_platform_tags::PlatformTag::is_linux)
|
||||
{
|
||||
if platform_tags.iter().all(PlatformTag::is_linux) {
|
||||
if graph.graph[node_index].marker().is_disjoint(*LINUX_MARKERS) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if platform_tags
|
||||
.iter()
|
||||
.all(uv_platform_tags::PlatformTag::is_windows)
|
||||
{
|
||||
if platform_tags.iter().all(PlatformTag::is_windows) {
|
||||
// TODO(charlie): This omits `win_ia64`, which is accepted by Warehouse.
|
||||
if graph.graph[node_index]
|
||||
.marker()
|
||||
|
@ -314,28 +308,19 @@ impl Lock {
|
|||
}
|
||||
}
|
||||
|
||||
if platform_tags
|
||||
.iter()
|
||||
.all(uv_platform_tags::PlatformTag::is_macos)
|
||||
{
|
||||
if platform_tags.iter().all(PlatformTag::is_macos) {
|
||||
if graph.graph[node_index].marker().is_disjoint(*MAC_MARKERS) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if platform_tags
|
||||
.iter()
|
||||
.all(uv_platform_tags::PlatformTag::is_arm)
|
||||
{
|
||||
if platform_tags.iter().all(PlatformTag::is_arm) {
|
||||
if graph.graph[node_index].marker().is_disjoint(*ARM_MARKERS) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if platform_tags
|
||||
.iter()
|
||||
.all(uv_platform_tags::PlatformTag::is_x86_64)
|
||||
{
|
||||
if platform_tags.iter().all(PlatformTag::is_x86_64) {
|
||||
if graph.graph[node_index]
|
||||
.marker()
|
||||
.is_disjoint(*X86_64_MARKERS)
|
||||
|
@ -344,10 +329,7 @@ impl Lock {
|
|||
}
|
||||
}
|
||||
|
||||
if platform_tags
|
||||
.iter()
|
||||
.all(uv_platform_tags::PlatformTag::is_x86)
|
||||
{
|
||||
if platform_tags.iter().all(PlatformTag::is_x86) {
|
||||
if graph.graph[node_index].marker().is_disjoint(*X86_MARKERS) {
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue