Skip to content
Draft
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
14 changes: 14 additions & 0 deletions crates/uv-resolver/src/resolver/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1468,6 +1468,20 @@ impl<InstalledPackages: InstalledPackagesProvider> ResolverState<InstalledPackag
return Ok(None);
}

// If the distribution doesn't have any wheels for the current environment, mark it as
// unavailable. For example, if the user is solving for `sys_platform == 'darwin'` and the
// package only has Windows wheels, the package should be marked as unavailable.
if !env.included_by_marker(dist.implied_markers()) {
return Ok(Some(ResolverVersion::Unavailable(
candidate.version().clone(),
UnavailableVersion::IncompatibleDist(IncompatibleDist::Wheel(
IncompatibleWheel::MissingPlatform(
env.fork_markers().unwrap_or(MarkerTree::TRUE),
),
)),
)));
}

// If the user explicitly marked a platform as required, ensure it has coverage.
for marker in self.options.required_environments.iter().copied() {
// If the platform is part of the current environment...
Expand Down
Loading