Persist per-package exclude-newer exceptions for uv (pnpm-style), not just an ephemeral CLI flag
#45113
alakae
started this conversation in
Suggest an Idea
Replies: 1 comment 1 reply
|
Small update: this also affects uv's native project mode (pyproject.toml [project] + uv.lock), not just the pip-compile interface. A CLI-only |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Tell us more.
Hi! Posting this because I'm genuinely stuck on the problem below and, as far as I can tell, it isn't solved yet, so I'm filing it as a feature request in case I'm missing something. If there's already a good workaround (or a reason this is intentionally out of scope), I'd love to hear it just as much as a "yes, let's build this."
Small disclaimer: this reflects my current best understanding of the landscape (uv's cooldown config, Renovate's
minimumReleaseAge/vulnerabilityAlerts, and how the two interact) after digging through docs and issues. Happy to be corrected if I've got something wrong.The problem
uv supports a dependency "cooldown" via
exclude-newerinpyproject.toml/uv.toml, which makes uv ignore any package version uploaded within a configured duration (e.g. 7 days).#41654tracks passing--exclude-newerto uv, modeled on how Renovate already passes--before=<date>to npm during lock file generation: an ephemeral CLI flag, applied per invocation, written nowhere.Renovate's own docs already recommend keeping this kind of setting in sync between Renovate and the package manager:
That guidance is about keeping the default cutoff aligned (so transitive dependencies pulled in during a delegated lockfile update don't slip past Renovate's own check). It doesn't cover the case below: a security-driven exception that needs to diverge from that default for one package, for one release.
That's the case
#41654's ephemeral-flag design doesn't help with. Renovate'svulnerabilityAlertsconfig already bypassesminimumReleaseAgeso it opens the PR immediately, but when it then shells out touv pip compileto regenerate the lockfile, there's nothing that lets that specific update through while the rest of the project keeps respecting the cooldown. An ephemeral--exclude-newerflag, even if implemented, only relaxes the cutoff for the whole invocation, and isn't recorded anywhere uv reads on a subsequent plain resolve.Concretely, this breaks any project that verifies its lockfile is up to date by re-resolving and diffing (e.g. a CI job running
uv pip compilethengit diff --exit-code requirements.txt, oruv lock --check). That's the common (?) way to catch arequirements.txt/lockfile that's drifted from its source, since there's no check that verifies consistency without re-resolving:The first command produces a
requirements.txta plain recompile can't reproduce. The very next plain resolve, in CI or by another developer, fails, because nothing in the committed config explains why that version was allowed through. The second is what we'd want Renovate to commit for us.What I'd like
For uv projects, when Renovate raises a security-driven update that falls inside the configured
exclude-newercooldown, have it write a scoped, persisted exception intopyproject.toml(oruv.toml) alongside the version bump, instead of (or in addition to) passing an ephemeral CLI flag (see the second snippet above).This is the uv analogue of what Renovate now does for pnpm (renovatebot/renovate#40020): security updates get a
minimumReleaseAgeExcludeentry written intopnpm-workspace.yaml, a persisted exemption, not a CLI flag (pnpm docs). Applying the same pattern to uv via its nativeexclude-newer-packagesetting would mean:uv pip compile/uv lock(no special flags) reproduces the same resolution, so CI drift checks stay green instead of failing on the very next resolve.Suggested behavior:
exclude-newer-packageentry for the affected package in the same table as the existingexclude-newersetting (don't splitexclude-newerandexclude-newer-packageacross[tool.uv]and[tool.uv.pip]).Alternatives I've considered
#41654, the an ephemeral CLI flag only (the currently tracked design). Solves nothing for projects with a re-resolve-based drift check: Renovate's own PR would become unreproducible the moment anyone else runs a plainuv lock/uv pip compile.exclude-newer-packageentry by hand, with a comment noting the reason and a removal date, then regenerates the lockfile. Works, but defeats the point of using Renovate for security updates: someone still has to notice the CVE and write the config change themselves.exclude-newer-package = { pkg = false }(permanent exemption) instead of a dated cutoff. Rejected because it never expires: the next release of that package also bypasses the cooldown until someone remembers to remove the line.Links
exclude-newer-packagesetting: https://docs.astral.sh/uv/reference/settings/#exclude-newer-package--exclude-newertouv#41654exclude-newer-packageentries onuv lockastral-sh/uv#18792All reactions