Skip to content

Conversation

@marcvernet31
Copy link

Summary

When exclude-newer filters out all candidates for a package, the debug output doesn't indicate that the date filter was applied. This makes it difficult to diagnose why no compatible versions are found. Issue described here: #16485

Example scenario:

  • User pins mlx==0.29.3 (published on 2025-10-18)
  • User sets exclude-newer = "2025-10-11T00:00:00Z"
  • Resolution fails silently as there is no matching version found for mlx.

New output:

DEBUG Searching for a compatible version of mlx (>=0.29.3, <0.29.3+)
DEBUG Excluding candidates for mlx published after 2025-10-11T00:00:00Z
TRACE Exhausted all candidates for package mlx with range >=0.29.3, <0.29.3+ after 1 steps
DEBUG No compatible version found for: mlx

Test Plan

Tested with:

# pyproject.toml
[project]
dependencies = ["mlx==0.29.3"]

[tool.uv]
exclude-newer = "2025-10-11T00:00:00Z"  

Running uv lock -vvv now shows the exclude-newer debug message.

/// The returned [`Candidate`] _may not_ be compatible with the current platform; in such
/// cases, the resolver is responsible for tracking the incompatibility and re-running the
/// selection process with additional constraints.
#[allow(unused_variables)] // exclude_newer is unused here, logging handled at higher level
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand why we need to pass it through here if it's not used here?

Comment on lines +1288 to +1290
debug!(
"Excluding candidates for {name} published after {exclude_newer_ts}"
);
Copy link
Member

@zanieb zanieb Nov 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this being logged if exclude newer is set and we visit this package? That seems misleading? Shouldn't we only log it if we actually filtered a distribution due to exclude newer?

Why should we have this in a debug log rather than a hint on failed resolution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants