chore(release): sync pyproject version with the release-please manifest and auto-bump it on release - #332
Conversation
…st and auto-bump it on release Replace the hard-coded pyproject.toml version (stale at 0.7.0 while .release-please-manifest.json had reached 0.9.0 — the reopened class of #174, which a one-time bump in v0.8.x had already failed to prevent) with 0.9.0, and switch release-please-config.json from release-type "simple" to "python": the python strategy's PyProjectToml updater rewrites [project].version in the same "release: X.Y.Z" PR as the manifest bump, and no other version-bearing files exist in this repo for it to touch. uv.lock, the second stale self-pin (0.1.0), was already removed in #331. Add tests/test_release_version_sync.py so CI fails whenever the pyproject version drifts from .release-please-manifest.json or the release-type regresses to a strategy that does not update pyproject.toml, closing the recurrence path this drift class kept reopening. Fixes #330 Signed-off-by: Saffron <263493777+itsmiso-ai@users.noreply.github.com>
There was a problem hiding this comment.
AI Automated Review
Full PR review.
Analysis engine: MiniMax-M2.7@https://litellm.jory.dev/v1 (anthropic) — primary route
Review: PR PR 332 — Sync pyproject version with release-please manifest
Recommendation: Approve.
This PR cleanly addresses the root cause of PR 330 (version drift between pyproject.toml and .release-please-manifest.json) by:
- Bumping
pyproject.toml's[project].versionfrom0.7.0to0.9.0(matching the released state) - Switching
release-please-config.jsonfromrelease-type: simpletorelease-type: python— the key structural fix that makes future releases auto-sync the version field - Adding
tests/test_release_version_sync.pyas a permanent guardrail that will fail CI if drift recurs or if someone switches back to a non-python release type
The uv.lock drift mentioned in issue PR 330 was addressed separately in PR 331 (commit e5235e9), which the new test file's docstring explicitly acknowledges.
Change-by-change findings
pyproject.toml — Version field updated from 0.7.0 to 0.9.0. This matches the state of .release-please-manifest.json at the time of the fix (the manifest had advanced past 0.7.8 through the v0.8.0 and v0.9.0 releases). No dependency packages are upgraded here — this is a project-metadata sync, not a dependency upgrade in the Python-package sense.
release-please-config.json — release-type switched from "simple" to "python". The simple strategy only updates the manifest and changelog; the python strategy additionally rewrites [project].version in pyproject.toml on every release. The test file's docstring explains this precisely and notes that no __init__.py/version.py/setup.py/setup.cfg exist in this repo, so the python updater has exactly one file to touch. This is the recurrence-prevention mechanism that issue PR 330 called for.
tests/test_release_version_sync.py — New test file with three tests:
test_pyproject_version_matches_release_manifest: assertspyproject.toml's[project].versionequals the manifest's root" ."entry — the exact invariant that PR 330 kept re-filingtest_release_config_still_uses_the_python_release_type: asserts the config still uses"python"so a future re-nerf is caughttest_version_agreement_logic: parametrized table of(pyproject_version, manifest_version, ok)tuples that pin the comparison logic, including the exact states that PR 330 was filed against (0.7.0vs0.7.8,0.7.0vs0.9.0)
The file reads are hardcoded to REPO_ROOT / "pyproject.toml", REPO_ROOT / ".release-please-manifest.json", and REPO_ROOT / "release-please-config.json". No user-controlled paths are involved.
Required checks — what was verified
| Check | Status |
|---|---|
| Breaking API changes in updated dependencies | Not applicable. This is not a dependency upgrade — no Python packages are changed. The version bump is project metadata only. |
| Run full test suite after upgrade | Verified. CI reached terminal state with test: success and docker: success for commit 494a1a7. |
| Review for path traversal vulnerabilities | Verified. REPO_ROOT is derived from Path(__file__).resolve().parent.parent and combined with hardcoded filenames. No user-supplied path input reaches any file operation. |
| Test with edge-case paths (null bytes, symlinks) | Verified. Paths are hardcoded constants; resolve() normalizes symlinks but the inputs are not attacker-controlled. The open(encoding="utf-8") and tomllib.load paths are standard library and safe. |
Standards Compliance
The AGENTS.md convention requires that issues state the ask in one imperative sentence and name concrete file paths. Issue PR 330 named pyproject.toml and .release-please-manifest.json; this PR additionally touches release-please-config.json (the auto-bump mechanism) and adds a test file — scope expansion that is directly in service of the "prevent recurrence" acceptance criterion. The new test file's docstring is unusually thorough, citing the exact issues and commit hashes that motivated each decision, which benefits future reviewers.
No AGENTS.md conventions are violated.
Linked Issue Fit
Issue PR 330 acceptance criteria:
- ✅
pyproject.tomlversion is set to match.release-please-manifest.json(0.9.0 — the manifest's current value, not 0.7.8, because intervening releases advanced it) - ✅
release-please-config.jsonusesrelease-type: python, which auto-updatespyproject.tomlon every release — recurrence is structurally prevented - ✅ CI test added to fail when the two drift (first test) or when the tooling is re-nerfed (second test)
- ✅
uv.lockhandled in the same release-prep pass (PR 331, already merged to main)
All acceptance criteria are satisfied.
Syncs pyproject.toml with the release manifest by switching release-please to the python strategy and adding CI tests to prevent future drift.
Fixes #330
Opened by foreman on review GO (workload wl-misospace-foreman-dispatch-bridge-330).