Skip to content

build: adopt uv exclude-newer and source CI tool versions from mise#637

Merged
pdecat merged 1 commit into
masterfrom
build/uv-exclude-newer
Jul 16, 2026
Merged

build: adopt uv exclude-newer and source CI tool versions from mise#637
pdecat merged 1 commit into
masterfrom
build/uv-exclude-newer

Conversation

@pdecat

@pdecat pdecat commented Jul 16, 2026

Copy link
Copy Markdown
Member

What

pyproject.toml [tool.uv]

  • exclude-newer = "7 days" — cap lockfile resolution to artifacts at least 7 days old, matching the Renovate minimumReleaseAge: "7 days" policy so local uv lock / lockFileMaintenance and Renovate agree on what counts as "too new".
  • default-groups = "all" (was ["test"]) — include every dependency group by default.

uv.lock regenerated: only adds the relative [options] block (exclude-newer-span = "P7D"); nothing rolled back since no dependency was newer than 7 days. uv reads exclude-newer from pyproject.toml, so CI reproduces the same lock (no git diff churn in the lint job).

.gitlab-ci.yml: drop the hardcoded UV_VERSION (had drifted to 0.11.1 vs mise's 0.11.28) and PYTHON_VERSION, sourcing both from the shared tool versions job that parses the mise config. The 3.10–3.14 test matrix is kept but renamed to PYTHON_TEST_VERSION — the dotenv-provided PYTHON_VERSION has higher CI variable precedence than parallel:matrix, so a same-named matrix var would collapse to a single version.

Notes

  • No Renovate change needed: minimumReleaseAge (gates PR creation) and exclude-newer (gates lock resolution) are complementary, both at 7 days.
  • The relative window is recorded as a stable span, so uv lock --check / uv run don't re-lock as it slides forward — it only advances on an explicit re-resolution (dep bump, uv lock --upgrade, or lockFileMaintenance).

Set [tool.uv] exclude-newer = "7 days" so lockfile resolution matches the
Renovate minimumReleaseAge policy, and default-groups = "all" to include
every dependency group by default. Regenerating uv.lock adds the relative
exclude-newer-span = "P7D" options block.

Drop the hardcoded UV_VERSION (drifted to 0.11.1 vs mise's 0.11.28) and
PYTHON_VERSION from .gitlab-ci.yml, sourcing both from the shared helpers
"tool versions" job that parses the mise config. Keep the 3.10-3.14 test
matrix under PYTHON_TEST_VERSION so the dotenv PYTHON_VERSION (higher CI
variable precedence) does not collapse it.
@github-actions

Copy link
Copy Markdown
Contributor

Coverage report

This PR does not seem to contain any modification to coverable code.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Build: align uv lock resolution with Renovate and source CI tool versions from mise

⚙️ Configuration changes ✨ Enhancement 🕐 10-20 Minutes

Grey Divider

AI Description

• Align uv lock resolution with Renovate by excluding packages newer than 7 days.
• Make uv include all dependency groups by default to match CI/local installs.
• Source Python/uv versions in GitLab CI from mise via the shared tool-versions job.
Diagram

graph TD
M["mise.toml"] --> TV["CI: tool versions"] --> L["CI: lint"]
TV --> T["CI: tox matrix"]
P["pyproject.toml (uv config)"] --> U["uv.lock"]
L --> U
T --> U
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Keep tool versions pinned directly in .gitlab-ci.yml
  • ➕ No dependency on external helper include/job
  • ➕ Versions are immediately visible in the CI file
  • ➖ Drifts from developer tooling (mise) over time
  • ➖ Requires updating CI and mise in lockstep
2. Use an absolute exclude-newer timestamp (fixed date) instead of a relative window
  • ➕ Fully deterministic cutoff until manually changed
  • ➕ Avoids any confusion about “sliding windows”
  • ➖ Requires frequent manual updates to move the cutoff forward
  • ➖ Harder to align with Renovate’s minimumReleaseAge policy
3. Rely on Renovate minimumReleaseAge only (no uv exclude-newer)
  • ➕ Fewer uv-specific knobs
  • ➕ Renovate remains the single gate for new deps
  • ➖ Local/CI re-locking can still select very recent artifacts
  • ➖ Increases risk of CI-only lock drift during maintenance runs

Recommendation: Proceed with the PR’s approach: sourcing Python/uv from mise removes version drift, and uv’s relative exclude-newer aligns lock resolution with Renovate’s release-age policy while keeping uv.lock stable between runs. The PYTHON_TEST_VERSION rename is the right mitigation for GitLab variable precedence so the matrix doesn’t collapse.

Files changed (3) +18 / -6

Other (3) +18 / -6
.gitlab-ci.ymlDerive Python/uv versions from helper job and fix test matrix var precedence +11/-4

Derive Python/uv versions from helper job and fix test matrix var precedence

• Includes the shared tool_versions.yml helper and adds a needs dependency so lint/tox consume dotenv-exported tool versions (matching mise). Removes hardcoded PYTHON_VERSION/UV_VERSION pins, and renames the tox matrix variable to PYTHON_TEST_VERSION to avoid collision with the higher-precedence dotenv PYTHON_VERSION.

.gitlab-ci.yml

pyproject.tomlConfigure uv to resolve with a 7-day exclude-newer window and include all groups +2/-1

Configure uv to resolve with a 7-day exclude-newer window and include all groups

• Sets [tool.uv] default-groups to "all" so all dependency groups are considered by default. Adds exclude-newer = "7 days" to keep lockfile resolution from selecting too-recent artifacts and to match Renovate’s minimum release age policy.

pyproject.toml

uv.lockRegenerate lockfile to record exclude-newer span options +5/-1

Regenerate lockfile to record exclude-newer span options

• Adds an [options] block capturing the relative exclude-newer span (P7D) for stable, reproducible resolution. Includes a minor normalization in a dependency marker entry consistent with the regenerated lock output; no intentional dependency rollbacks indicated.

uv.lock

@qodo-code-review

Copy link
Copy Markdown

Qodo is busy working

Check back in a few minutes. Qodo's code review agents are on it.

Grey Divider

@pdecat
pdecat merged commit 68f5b8c into master Jul 16, 2026
14 checks passed
@pdecat
pdecat deleted the build/uv-exclude-newer branch July 16, 2026 10:13
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.

1 participant