chore(renovate): update the apm pin in pyproject.toml and uv.lock #523

Merged
Defame1297 merged 5 commits from chore/518-renovate-uv into main 2026-12-06 08:40:14 +00:00
Owner

What and why

Closes #518

Renovate now updates the apm pin in pyproject.toml and uv.lock. Each update gets its own pull request, with automerge off: CI never runs apm, so a green run says nothing about a new version.

The bot-diff check now accepts such a pull request, and nothing more. uv.lock is parsed and compared as data, by the new scripts/check_uv_lock.py. A bot pull request passes only when:

  • pyproject.toml and uv.lock change together;
  • apm-cli moves up to the new pin, in both files;
  • apm-cli's source and dependencies stay the same;
  • its files are PyPI downloads named for apm-cli at the new version, with sha256 hashes, and of the same kinds as before (sdist or not, same wheel tags);
  • every other package, and every top-level setting except revision, stays exactly as it was.

Anything else is refused, and a person makes that bump by hand.

Why parsed: uv installs whatever the lock names. A per-line check let a bot pull request swap in another PyPI project under apm-cli's name, add a package, switch off a dependency with a marker, or make uv build apm-cli from source. Each of these is now a regression test.

Other changes:

  • uv.lock rewritten: it is now in the form the Renovate image's uv 0.13.1 writes. Only revision (3 to 5) and two redundant markers on httpcore2 change. uv export --frozen --all-groups is identical before and after.
  • renovate.json:
    • pep621 is enabled for pyproject.toml;
    • requires-python is not updated;
    • lock file maintenance is off for uv.lock, which the check would refuse anyway;
    • the top-level description now covers the new allowance.
  • .gitea/workflows/AGENTS.md: the bot pull request rule now covers the new allowance.
  • Script length: check_bot_pr_diff.py was already over the 200-line soft limit, at 359 lines. It grows to 405, for the pyproject.toml pin rule and the uv.lock dispatch. The uv.lock rule itself is a module of its own (198 lines). Splitting out the remaining per-file rules is a separate change.

Verified

  • renovate --platform=local at 44.161.0, whole repository, exit 0 (before the final round of check changes; renovate.json is unchanged since):

    {"depName":"apm-cli","depType":"dependency-groups","currentValue":"==0.39.3","updates":[{"newValue":"==0.39.4","branchName":"renovate/apm-cli-0.x"}]}
    {"depName":"python","depType":"requires-python","skipReason":"disabled","updates":[]}
    

    A branch-level trace showed "automerge": false, "groupName": null for renovate/apm-cli-0.x. With the new rule, lock file maintenance no longer produces a uv.lock branch, and the pip-compile locks still do.

  • renovate-config-validator --strict passes.

  • A real bump: 0.39.3 to 0.39.4 with uv 0.13.1 passes the check exactly as Lint runs it, and uv sync --frozen then installs apm-cli 0.39.4.

  • Refused by the check:

    • another PyPI project under apm-cli's name;
    • a new package;
    • a dependency switched off by a marker;
    • wheels dropped;
    • a downgrade;
    • pyproject.toml without uv.lock, and the reverse;
    • another source or download host;
    • dot segments in a file's path.

    Each is a test, written to fail against the earlier rules.

  • python3 -m unittest discover -s tests/scripts: 374 tests pass.

  • Three independent review rounds tried to get past the check. The last one found no way to change what uv sync --frozen installs or runs beyond the bump.

  • ansible-test sanity: passed in the pre-push hook.

Not verified

  • No real Renovate pull request yet. The bot's lock change is assumed from running uv 0.13.1 by hand.
  • Backslashes in a file URL: the path check does not refuse them, and uv reads them as /. The host is fixed and the file name must still be apm-cli's own, so only the real file can be fetched, and uv checks its hash. A small follow-up.
  • Mutation testing left three gaps:
    • the sdist file-name rule has no test of its own, though it works when run;
    • a test that 0.40 to 0.40.0 is refused is missing;
    • revision = true passes the check, though uv refuses it at sync time.
  • The rewrite commit's message: it says uv 0.11.24 "leaves" the lock as it is. That holds for uv lock --check. uv lock --upgrade-package with a uv older than 0.13 rewrites the lock in the old form, which the check then refuses for later bot bumps. That fails closed, but the lock has to be written with uv 0.13 or later.
  • Molecule was not run locally.

  • I confirm third-party material is recorded in NOTICE and REUSE.toml, or there is none.

Assisted-by: Claude Code

## What and why Closes #518 Renovate now updates the apm pin in `pyproject.toml` and `uv.lock`. Each update gets its own pull request, with automerge off: CI never runs apm, so a green run says nothing about a new version. The bot-diff check now accepts such a pull request, and nothing more. `uv.lock` is parsed and compared as data, by the new `scripts/check_uv_lock.py`. A bot pull request passes only when: - `pyproject.toml` and `uv.lock` change together; - apm-cli moves up to the new pin, in both files; - apm-cli's source and dependencies stay the same; - its files are PyPI downloads named for apm-cli at the new version, with sha256 hashes, and of the same kinds as before (sdist or not, same wheel tags); - every other package, and every top-level setting except `revision`, stays exactly as it was. Anything else is refused, and a person makes that bump by hand. Why parsed: uv installs whatever the lock names. A per-line check let a bot pull request swap in another PyPI project under apm-cli's name, add a package, switch off a dependency with a marker, or make uv build apm-cli from source. Each of these is now a regression test. Other changes: - **`uv.lock` rewritten:** it is now in the form the Renovate image's uv 0.13.1 writes. Only `revision` (3 to 5) and two redundant markers on httpcore2 change. `uv export --frozen --all-groups` is identical before and after. - **`renovate.json`:** - pep621 is enabled for `pyproject.toml`; - `requires-python` is not updated; - lock file maintenance is off for `uv.lock`, which the check would refuse anyway; - the top-level description now covers the new allowance. - **`.gitea/workflows/AGENTS.md`:** the bot pull request rule now covers the new allowance. - **Script length:** `check_bot_pr_diff.py` was already over the 200-line soft limit, at 359 lines. It grows to 405, for the `pyproject.toml` pin rule and the `uv.lock` dispatch. The `uv.lock` rule itself is a module of its own (198 lines). Splitting out the remaining per-file rules is a separate change. ## Verified - `renovate --platform=local` at 44.161.0, whole repository, exit 0 (before the final round of check changes; `renovate.json` is unchanged since): ``` {"depName":"apm-cli","depType":"dependency-groups","currentValue":"==0.39.3","updates":[{"newValue":"==0.39.4","branchName":"renovate/apm-cli-0.x"}]} {"depName":"python","depType":"requires-python","skipReason":"disabled","updates":[]} ``` A branch-level trace showed `"automerge": false, "groupName": null` for `renovate/apm-cli-0.x`. With the new rule, lock file maintenance no longer produces a `uv.lock` branch, and the pip-compile locks still do. - `renovate-config-validator --strict` passes. - **A real bump:** 0.39.3 to 0.39.4 with uv 0.13.1 passes the check exactly as Lint runs it, and `uv sync --frozen` then installs apm-cli 0.39.4. - **Refused by the check:** - another PyPI project under apm-cli's name; - a new package; - a dependency switched off by a marker; - wheels dropped; - a downgrade; - `pyproject.toml` without `uv.lock`, and the reverse; - another source or download host; - dot segments in a file's path. Each is a test, written to fail against the earlier rules. - `python3 -m unittest discover -s tests/scripts`: 374 tests pass. - Three independent review rounds tried to get past the check. The last one found no way to change what `uv sync --frozen` installs or runs beyond the bump. - `ansible-test sanity`: passed in the pre-push hook. ## Not verified - No real Renovate pull request yet. The bot's lock change is assumed from running uv 0.13.1 by hand. - **Backslashes in a file URL:** the path check does not refuse them, and uv reads them as `/`. The host is fixed and the file name must still be apm-cli's own, so only the real file can be fetched, and uv checks its hash. A small follow-up. - **Mutation testing** left three gaps: - the sdist file-name rule has no test of its own, though it works when run; - a test that `0.40` to `0.40.0` is refused is missing; - `revision = true` passes the check, though uv refuses it at sync time. - **The rewrite commit's message:** it says uv 0.11.24 "leaves" the lock as it is. That holds for `uv lock --check`. `uv lock --upgrade-package` with a uv older than 0.13 rewrites the lock in the old form, which the check then refuses for later bot bumps. That fails closed, but the lock has to be written with uv 0.13 or later. - Molecule was not run locally. --- - [x] I confirm third-party material is recorded in `NOTICE` and `REUSE.toml`, or there is none. Assisted-by: Claude Code
Claude added 3 commits 2026-12-06 07:35:17 +00:00
A Renovate pull request may now change pyproject.toml and uv.lock, but
only together, so the pep621 manager can move the apm pin. In
pyproject.toml only the version of a quoted name==version pin may change.

uv.lock is parsed with tomllib in a module of its own, check_uv_lock.py,
because uv installs whatever the lock names and a line-shape rule cannot
tie a file to its package: a file of another package under apm-cli, an
added package, a marker that drops a dependency and a downgrade all passed
one. The parsed rule allows only apm-cli moving up to the pin in
pyproject.toml, as plain releases compared as numbers, with the same kinds
of file as before (an sdist if it had one, the same wheel tags), each on
files.pythonhosted.org under /packages/ without dot segments or escapes,
named for apm-cli at the pin, by sha256. Every other package, the root
project beyond its apm-cli specifier and the top level beyond `revision`
must stay as they are. Without the same file kinds, a lock could drop the
wheels and make uv build apm-cli from its sdist with a build backend
fetched at sync time. A bump that moves anything else is made by hand.

Refs: #518

Assisted-by: Claude Code
uv 0.13.1, the version in the pinned Renovate image, writes lock revision
5 and drops two markers on httpcore2's dependencies that uv 0.11 kept.
The bot-diff check refuses a change to any package but apm-cli, so the
lock is rewritten once here, with `uv lock --upgrade-package apm-cli` at
the unchanged pin. No package, version, source, file or hash changes, and
uv 0.11.24 reads the lock and leaves it as it is.

Refs: #518

Assisted-by: Claude Code
chore(renovate): update the apm pin in pyproject.toml and uv.lock
Build / build (pull_request) Successful in 49s
Molecule / select (pull_request) Successful in 2s
Lint / lint (pull_request) Successful in 4m48s
Molecule / Result (pull_request) Canceled after 0s
Molecule / scenarios (pull_request) Canceled after 16m17s
2b0326801f
Enable the pep621 manager for the root pyproject.toml, which updates
uv.lock with it. apm-cli gets its own pull request without automerge: CI
never runs apm, so a green run says nothing about a new version. The
manager also reads requires-python, a floor for ruff rather than a pin,
so it is disabled, and lock file maintenance is off for uv.lock, whose
check refuses a change to any package but apm-cli.

Closes: #518

Assisted-by: Claude Code
CODEOWNERS rules requested review from Defame1297 2026-12-06 07:35:17 +00:00
Defame1297 added 1 commit 2026-12-06 07:52:22 +00:00
Merge branch 'main' into chore/518-renovate-uv
Build / build (pull_request) Successful in 29s
Molecule / select (pull_request) Successful in 8s
Lint / lint (pull_request) Successful in 3m39s
Molecule / Result (pull_request) Canceled after 0s
Molecule / scenarios (pull_request) Canceled after 11m3s
6d054b0f8b
Defame1297 added 1 commit 2026-12-06 08:03:58 +00:00
Merge branch 'main' into chore/518-renovate-uv
Build / build (pull_request) Successful in 31s
Molecule / select (pull_request) Successful in 4s
Lint / lint (pull_request) Successful in 3m37s
Molecule / scenarios (pull_request) Successful in 35m29s
Molecule / Result (pull_request) Successful in 1s
5a130f143f
Defame1297 scheduled this pull request to auto merge when all checks succeed 2026-12-06 08:04:03 +00:00
Defame1297 approved these changes 2026-12-06 08:04:11 +00:00
Defame1297 merged commit d1db4fb0db into main 2026-12-06 08:40:14 +00:00
Defame1297 deleted branch chore/518-renovate-uv 2026-12-06 08:40:15 +00:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mortis/Kamino#523