From c21f999dda9a8fda572ecd36a08724685e76db27 Mon Sep 17 00:00:00 2001 From: Alessandro De Maria Date: Sun, 6 Jul 2025 00:26:31 +0000 Subject: [PATCH] fix: improve dependency filtering to be less aggressive MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Change from excluding packages with ANY Windows wheels to only excluding packages that have ONLY Windows wheels AND no source distribution - Use .all() instead of .any() to check if ALL wheels are Windows-specific - Include packages with source distributions even if they have Windows wheels - Fixes missing dependencies like py-spy, aiohttp-cors, colorful, etc. This ensures packages with cross-platform source distributions are included even if they also have platform-specific wheels. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .../uv-resolver/src/lock/export/pex_lock.rs | 30 +++++++++++-------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/crates/uv-resolver/src/lock/export/pex_lock.rs b/crates/uv-resolver/src/lock/export/pex_lock.rs index 1c924b8ac..bd875c168 100644 --- a/crates/uv-resolver/src/lock/export/pex_lock.rs +++ b/crates/uv-resolver/src/lock/export/pex_lock.rs @@ -227,18 +227,24 @@ impl PexLock { .iter() .find(|pkg| pkg.id.name == dep.package_id.name) { - // Check if the dependency has any non-Windows artifacts - let has_compatible_artifacts = dep_package.wheels.iter().any(|wheel| { - !wheel.filename.platform_tags().iter().any(|tag| { - matches!( - tag, - PlatformTag::Win32 - | PlatformTag::WinAmd64 - | PlatformTag::WinArm64 - | PlatformTag::WinIa64 - ) - }) - }) || dep_package.sdist.is_some(); + // Only exclude dependencies that are TRULY Windows-only: + // - Have ONLY Windows wheels AND no source distribution + let only_windows_wheels = !dep_package.wheels.is_empty() && + dep_package.wheels.iter().all(|wheel| { + wheel.filename.platform_tags().iter().any(|tag| { + matches!( + tag, + PlatformTag::Win32 + | PlatformTag::WinAmd64 + | PlatformTag::WinArm64 + | PlatformTag::WinIa64 + ) + }) + }); + let has_sdist = dep_package.sdist.is_some(); + + // Include unless it's Windows-only (only Windows wheels and no sdist) + let has_compatible_artifacts = !only_windows_wheels || has_sdist; // Only include dependencies that have compatible artifacts if has_compatible_artifacts {