Skip to content

🔧 build(release): towncrier changelog pipeline, backfill, and docs#626

Merged
gaborbernat merged 6 commits into
mainfrom
feat/release-docs-overhaul
Jul 14, 2026
Merged

🔧 build(release): towncrier changelog pipeline, backfill, and docs#626
gaborbernat merged 6 commits into
mainfrom
feat/release-docs-overhaul

Conversation

@gaborbernat

Copy link
Copy Markdown
Member

Releases 3.29.5, 3.29.6, and 3.29.7 shipped to PyPI with no changelog entries. The release job that writes docs/changelog.rst only runs on workflow_dispatch, while the publish job runs on any tag push, so a tag pushed by hand publishes and cuts a GitHub release while nothing updates the changelog. 🔒 This PR adopts a fragment-based pipeline that closes that hole and backfills the missing history.

Each PR now drops a docs/changelog/<pr>.<type>.rst news fragment (types breaking, feature, bugfix, doc, packaging), and a CI gate fails any non-bot PR that lacks one. A prepare-release workflow folds the fragments into docs/changelog.rst with towncrier, commits, and tags; the publish job then refuses to release a version the changelog does not document, so a hand-pushed tag can no longer reach PyPI un-changelogged. Through sphinxcontrib-towncrier the built docs render the pending fragments as an Unreleased section, so the latest documentation shows what is coming. This PR drops the GitHub-API changelog generator in tasks/changelog.py, reconstructs the 3.29.5 through 3.29.7 sections from their merged PRs, and seeds the unreleased work since 3.29.7 as fragments.

The same review turned up stale and missing documentation. The docs now describe the Windows backend as LockFileEx over a byte range rather than msvcrt.locking, and state that native FileLock ignores lifetime with a warning rather than honoring it, matching the behavior since :pr:593. The five native lock options added since 3.29.7 (context_error_policy, close_error_policy, fallback_to_soft, preserve_lock_file, on_acquired) and the lock_descriptor/unlock_descriptor helpers had no prose at all; each gets a how-to section with a worked example, and switching autoclass_content makes the constructor parameter docs render. A few source-side loose ends ride along: the PR exports the two public policy type aliases from _api, corrects the versionadded markers on the new properties to the upcoming release, and drops some em dashes from user-facing strings.

Replace the GitHub-API changelog generator with towncrier news fragments.
A prepare-release workflow builds the changelog, commits, and tags; the
publish job refuses any tag whose version the changelog does not document,
so a hand-pushed tag can no longer reach PyPI without a changelog entry (as
3.29.5-3.29.7 did). A CI gate requires a fragment on every non-bot PR.

Backfill the missing 3.29.5, 3.29.6, and 3.29.7 sections and seed fragments
for the unreleased work.
Fix stale statements: the Windows backend uses LockFileEx, not
msvcrt.locking, and native FileLock ignores lifetime with a warning
rather than honoring it. Add how-to sections with examples for
context_error_policy, close_error_policy, fallback_to_soft,
preserve_lock_file, on_acquired, and the descriptor-lock helpers, and
render the __init__ parameter docs by switching autoclass_content.
Export CloseErrorPolicy and ContextErrorPolicy from _api, inline a
single-use Windows local, drop em dashes from user-facing strings, and
correct the versionadded markers on the new properties and descriptor
helpers to the upcoming release.
@gaborbernat gaborbernat marked this pull request as ready for review July 14, 2026 01:02
@gaborbernat gaborbernat enabled auto-merge (squash) July 14, 2026 01:02
@gaborbernat gaborbernat merged commit ea78a44 into main Jul 14, 2026
36 checks passed
@gaborbernat gaborbernat deleted the feat/release-docs-overhaul branch July 14, 2026 01:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment