Repository navigation
Conversation
bump_version.py also rewrites this package's entry in uv.lock, so CI can install with uv sync --locked. The versioning job runs uv lock --check before committing. Tests cover the rewrite with Hypothesis properties, examples and a differential check against the real lock. Part of #2128. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
99c9202 to
96a8a90
Compare
On a loaded runner Hypothesis can take over a second to draw the first set of unique package names and fails the too_slow health check, which says nothing about the rewrite under test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The lock is now updated before pyproject.toml, a missing lock is an error, and only the editable project entry is rewritten. New tests run the real script on a scratch repository: both files move together, and a missing lock or a lock without this package leaves both unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Coordination note from #2324 (untyped changelog fragments, #2314), which also edits Merging the two gives one conflict, in One of your tests then fails. #2324 makes (tmp_path / "pyproject.toml").write_text(
- f'[project]\nname = "{PACKAGE}"\nversion = "1.2.3"\n'
+ f'[project]\nname = "{PACKAGE}"\nversion = "1.2.3"\n\n'
+ '[tool.towncrier]\ndirectory = "changelog.d"\n\n'
+ '[[tool.towncrier.type]]\ndirectory = "fixed"\nname = "Fixed"\n'
)On a local merge of both branches with that change, all 56 tests in 🤖 Generated with Claude Code |
Takes main's rewritten versioning.yaml (prepare_release.py); the lock step moves into prepare_release.py next. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
prepare_release.py now stages uv.lock with pyproject.toml, CHANGELOG.md and the fragments, and check_release_diff allows uv.lock to change only in this package's own entry, only to the new version: the parsed lock must otherwise be identical and only one version line may change. Version commits that left the lock alone, as all earlier ones did, still pass --verify. The release tests' seed repository gets a uv.lock (with a dependency sharing the project's version) and the guard tests three lock faults and both accepted shapes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Ownership: session Since 10/10, main replaced the release workflow with 🤖 Generated with Claude Code |
The release outcome check accepts collect-skips in code_health only when the reason names .github (test_outcome_allowlist.toml); "needs the repository checkout" would have failed the release check and blocked Publish. Review finding on #2129. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Hand-off to the UK hub (session
🤖 Generated with Claude Code |
vahid-ahmadi
left a comment
There was a problem hiding this comment.
Looks right, fine to approve. Merging main first should make Release test pass.
@MaxGhenis, the lock step does what it says. I ran the real bump_version.py against main's uv.lock and pyproject.toml: one line changed, the package's own entry, from the stale 2.126.8 to 2.130.2. uv lock --check --offline fails on main's files today and passes after the bump. So the --frozen to --locked follow-up becomes possible after the first release.
- should: merge main before landing. Release test / Python 3/4 failed at
d49f71520ontest_uc_statutory_pay_properties.py::test_award_never_rises_with_a_claimants_statutory_pay. That is the wheel-only failure from #2397, which #2399 fixed on main after this run. It is not caused by this PR. The Result job accepted the new wheel skip reason: only that one test failed. The merge with main is clean. - nit:
.github/prepare_release.py:14. The docstring line is now about 120 characters; rewrap it. - Coordination, no change needed here: #2324 still edits
bump_version.py. Your note on this PR gives the import fix and the test fixture for whichever PR lands second.
The guard in lock_problems looks sound to me. It compares the parsed lock with only the package's version put back, and it also requires the text diff to be exactly one version line each way. A dependency change or a second version change is refused, and the tests cover both. An old-style version commit that leaves uv.lock alone still passes.
What I checked
- Fresh uv venv at
d49f71520(uv sync --frozen --extra dev). test_prepare_release.pyandtest_version_bump.py: 34 passed on the PR head, and 34 passed on a local merge with current main.bump_version.pyrun on a scratch copy holding main'suv.lockandpyproject.toml, thenuv lock --check --offlinebefore and after (results above).ruff checkandruff format --checkclean on the four changed Python files.- CI at
d49f71520: everything else passed; Publish was skipped. I did not run a real release. - None of my open PRs touch these files.
🤖 Generated with Claude Code
vahid-ahmadi
left a comment
There was a problem hiding this comment.
Approving, per my review comment above.
Aggregate impact on certified data: passBase Checks: 0 broken by this change, 1 failing on both sides, 0 fixed. Moves flagged for review: 0 (thresholds in Notes
Moves flagged for reviewNone. Spending by benefit and service
Caseloads
Household net income by decileNo household's net income changes in any year. No change in any year: receipts by tax head; government balance, each component counted once; model totals; household income totals; population; poverty rates; people in poverty; inequality; mean household net income in each side's own deciles; standard reform costings (change in gov_balance); standard reforms: change in each reform's target. Checks failing on both base and head (1)
Counted-once checkEach of 84 components was raised by £1 per unit in 2026-27, and every head of its totals was read household by household: its own head must rise by exactly £1, no other tax head may move, no other benefit may rise, and the model's own total must move by what its heads moved. A head that breaks a rule is measured again twice: with every other head held at its baseline value, and with every other head held at its value after the first £1 while the component rises again. It fails where either still shows the response. 0 failed; 0 were skipped. Provenance
Dataset: Receipts by tax head: head levels
Spending by benefit and service: head levels
Caseloads: head levels
Government balance, each component counted once: head levels
Model totals: head levels
Household income totals: head levels
Population: head levels
Poverty rates: head levels
People in poverty: head levels
Inequality: head levels
Mean household net income in each side's own deciles: head levels
Standard reform costings (change in gov_balance): head levels
Standard reforms: change in each reform's target: head levels
|
Part of #2128.
Reproducer: policyengine_uk/tests/code_health/test_prepare_release.py::test_a_release_extends_main_by_one_version_commit
What this does
uv.lockrecords this package's own version. Release commits bumppyproject.tomlbut not the lock, so the lock drifts behind: main's lock gives policyengine-uk an older version thanpyproject.toml. CI installs withuv sync --frozen, which ignores the drift. But it also means CI can't useuv sync --lockedoruv lock --check. Those are the checks that catch a PR that changes a dependency inpyproject.tomlwithout re-locking. Today such a PR is tested against the old pins and passes.This PR keeps the lock's own entry in step on every release:
.github/bump_version.pysets the version ofuv.lock's[[package]] name = "policyengine-uk"entry to the new version. That is the editable project entry, withsource = { editable = "." }. It rewrites only that line, so dependencies that share the old version string keep it. It stops before writing anything if the lock is missing or has no single such entry..github/prepare_release.pystagesuv.lockin the version commit.check_release_diff, which guards both new version commits and--verifyof existing ones, letsuv.lockchange only in this package's own entry, and only to the new version. The parsed lock must otherwise be identical, and exactly one version line may change. Version commits that left the lock alone, as every earlier one did, still pass.After this merges, the first release commit brings main's lock into step. A follow-up then switches the tests'
uv sync --frozento--locked, so a stale lock fails CI.Invariants (tested)
test_version_bump.pycovers this with Hypothesis properties, a differential check on the realuv.lock, and end-to-end runs of the script.uv.lockonly in this package's own entry, only to the versionpyproject.tomlnow carries, and a dependency sharing the old version keeps it.test_prepare_release.pycovers this against real git repositories.Mutation checks: if
uv.lockisn't staged, the release test fails; if the lock guard is disabled, three guard tests fail.Verified
test_prepare_release.pyandtest_version_bump.py: 34 passed locally (my edits added three guard cases and one accepted-shape test).ruff format --check,ruff check, andruff check --select F811,F821pass under the locked ruff 0.17.0 and the latest ruff.20261010-172929-pe-uk-2129-review, delta…181711…). Theprepare_release.pyhalf is new and is under review now.Coordination
#2324 also edits
bump_version.py; its owner's note above has the merge resolution and the test-fixture patch. Whichever PR lands second takes it.axiom: n/a: CI and release tooling only
🤖 Generated with Claude Code