🔧 build(release): towncrier changelog pipeline, backfill, and docs#626
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Releases 3.29.5, 3.29.6, and 3.29.7 shipped to PyPI with no changelog entries. The
releasejob that writesdocs/changelog.rstonly runs onworkflow_dispatch, while thepublishjob 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>.rstnews fragment (typesbreaking,feature,bugfix,doc,packaging), and a CI gate fails any non-bot PR that lacks one. Aprepare-releaseworkflow folds the fragments intodocs/changelog.rstwith towncrier, commits, and tags; thepublishjob then refuses to release a version the changelog does not document, so a hand-pushed tag can no longer reach PyPI un-changelogged. Throughsphinxcontrib-towncrierthe built docs render the pending fragments as anUnreleasedsection, so the latest documentation shows what is coming. This PR drops the GitHub-API changelog generator intasks/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
LockFileExover a byte range rather thanmsvcrt.locking, and state that nativeFileLockignoreslifetimewith 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 thelock_descriptor/unlock_descriptorhelpers had no prose at all; each gets a how-to section with a worked example, and switchingautoclass_contentmakes 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 theversionaddedmarkers on the new properties to the upcoming release, and drops some em dashes from user-facing strings.