feat(pep621): use exclude-newer during uv lock when minimumReleaseAge is set#41913
Open
thejoeejoee wants to merge 7 commits intorenovatebot:mainfrom
Open
feat(pep621): use exclude-newer during uv lock when minimumReleaseAge is set#41913thejoeejoee wants to merge 7 commits intorenovatebot:mainfrom
thejoeejoee wants to merge 7 commits intorenovatebot:mainfrom
Conversation
5f43c9b to
4bc8168
Compare
RahulGautamSingh
suggested changes
Mar 14, 2026
Collaborator
RahulGautamSingh
left a comment
There was a problem hiding this comment.
Please, use the PR template
Churro
suggested changes
Mar 14, 2026
Collaborator
There was a problem hiding this comment.
I think this could benefit from some refinement:
- With uv,
--exclude-newercan also be defined inpyproject.tomloruv.toml(see here). A CLI value always takes precedence but this creates a problem if thepyproject.tomlsetting is not the same value asminimumReleaseAge:- If it is more restrictive (older date), a less restrictive renovate
minimumReleaseAgewould override it and potentially allow packages the user explicitly wanted to exclude. - If it is less restrictive (newer date or absent), renovate correctly tightens the constraint.
- Suggestion: Read
exclude-newerfrompyproject.tomland, if present, use the more restrictive (older) date of the two, i.e.,min(renovate_minimum_release_age, pyproject_exclude_newer_date).
- If it is more restrictive (older date), a less restrictive renovate
- Using
UV_EXCLUDE_NEWERinstead of--exclude-newerwould be more consistent with the existing code style (UV_EXTRA_URL,UV_INDEX_*patterns). --exclude-newerworks only since uv 0.2.22. Unlikely that someone still uses such old versions but, strictly speaking, it would be necessary to check if a uv constraint is set and if < 0.2.22 to omit this setting. The elegance of the approach viaUV_EXCLUDE_NEWERenv var is that incompatible uv versions would simply ignore the setting.- Might also be worth a hint in renovate docs, considering that uv also explicitly exemplifies using this combination: https://docs.astral.sh/uv/guides/integration/dependency-bots/#dependency-cooldown
5e60f51 to
65df176
Compare
Author
|
Thanks, all four points are addressed in the later commits — min() of both dates, UV_EXCLUDE_NEWER env var (so old uv versions just ignore it), and a docs note linking the uv dependency guide. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
When
minimumReleaseAgeis configured, Renovate now passesUV_EXCLUDE_NEWERas an environment variable touv lock.Additionally, if
pyproject.tomlalready defines[tool.uv] exclude-newer, Renovate compares it with its own computed date and uses the more restrictive (older) one. This prevents Renovate from accidentally widening the package resolution window beyond what the project intended.📖 Related: uv documents recommended
exclude-newerusage for dependency bots in their integration guide.Key changes:
lib/modules/manager/types.ts— addedminimumReleaseAgetoUpdateArtifactsConfiglib/modules/manager/pep621/schema.ts— addedexclude-newertoUvConfigZod schema (handles both TOML string and Date types)lib/modules/manager/pep621/processors/uv.ts—UV_EXCLUDE_NEWERenv var withmin(renovate_date, pyproject_date)logiclib/modules/manager/pep621/processors/uv.spec.ts— 28 tests covering env var usage, min-date comparison, invalid values, and edge casesContext
--exclude-newertouv#41654AI assistance disclosure
opencode (Claude Opus 4.6 / Sonnet 4.6) used for test writing, and code review iteration
Documentation (please check one with an [x])
How I've tested my work (please select one)