Repository navigation
Keep scaffolded changelogs as scriv fragments - #4
Conversation
Two PRs that both add to `## [Unreleased]` in CHANGELOG.md conflict on every merge. Scaffolded projects now add one fragment per PR under changelog.d/ (`uv run scriv create`), and `uv run scriv collect` writes them into CHANGELOG.md at release time. - pyproject: scriv in the dev group and [tool.scriv] with Keep a Changelog categories, `## [X.Y.Z] - YYYY-MM-DD` headings, and the version read from __init__.py (library) or pyproject.toml (app). - changelog.d/TEMPLATE.md, and a scriv-insert-here marker in place of `## [Unreleased]`. - CHANGELOG.md is in _skip_if_exists, so copier update leaves a project's changelog alone. - RELEASING.md and the scaffold README describe the flow; template CI collects a fragment in both variants. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review of 399a60eThe core change works. I found one real problem for a named adopter, one undocumented side effect of 1. The library branch reads the wrong version for inspect_datasetWhere: What: Every Failure scenario: inspect_dataset adopts this by Fix: In the inspect_dataset adoption PR, set its How verified: Ran: in a rendered library with 2.
|
- compact_fragments = true: two fragments in one category no longer leave a blank line that makes the list loose and fails mdformat at release. Template CI now collects two same-category fragments and checks the list. - The scaffold README names `scriv collect` for every project kind, not only in RELEASING.md, and says to delete a fragment the change doesn't need. - The upgrade note quotes scriv's error when the marker is missing, says to check that [tool.scriv] version reads the file the build backend reads, and that _skip_if_exists recreates a missing CHANGELOG.md. From the review on #4. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks. Actioned in 4ed2dea:
Also added, from the reviews of the two adoption PRs: Left as is: Posted by Claude Code on Matt's behalf. |
Why
Scaffolded projects keep a hand-edited
## [Unreleased]section inCHANGELOG.md. Every PR adds lines at the same place, so any two open PRs conflict as soon as one merges. inspect-evals-lint has seven open PRs that each conflict with all the others on this one file.inspect_evals solves this with scriv: one fragment file per PR, collected into the changelog at release time. This brings the same setup into the template.
What changes in a scaffolded project
pyproject.toml:scriv>=1.8in the dev group.[tool.scriv]with Keep a Changelog categories and the existing## [X.Y.Z] - YYYY-MM-DDheading format.src/<pkg>/__init__.pyfor libraries and frompyproject.tomlfor apps, soscriv collectneeds no arguments.changelog.d/TEMPLATE.md: every category, commented out.uv run scriv createcopies it.CHANGELOG.md:<!-- scriv-insert-here -->replaces## [Unreleased].RELEASING.mdstep 2 becomesuv run scriv collect. The README's Development section says how to add a fragment.CHANGELOG.mdis added to_skip_if_exists. A project's changelog is its own once scaffolded. Without the skip, any template change to it would 3-way merge into a long project history and conflict. The downside is thatcopier updatewon't add the marker to existing projects. The template CHANGELOG's upgrade note covers the one manual step.Testing
scriv createproduces a fragment from the template, and the collectedCHANGELOG.mdandTEMPLATE.mdpass mdformat with the scaffold's.mdformat.toml.Rollout
After this is released (v1.9.0), inspect-evals-lint and inspect_dataset adopt it by
copier updatein their own PRs. Those PRs also move their current[Unreleased]entries into a fragment.Unrelated, noticed while here
Under
set -e, a command negated with!never fails the script, so the existing! grep -q …checks intemplate-ci.yml(typos, frontend, rulesets) can't fail the step.test ! -eis unaffected. The new check uses! grep … || exit 1. The existing ones are unchanged here.🤖 Generated with Claude Code