From 18e7d4717d6c6fdbbbaaf6b7ffb634d18c0fb206 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C4=9Bj=20Cepl?= Date: Mon, 30 Nov 2026 09:48:28 +0100 Subject: [PATCH 1/3] Collect changelog entries from per-PR fragments Nearly every pull request conflicted on the top of CHANGELOG.md, because all of them appended to the same "Upcoming release" section. Following a much simplified version of CPython's blurb/NEWS.d workflow, each PR now adds a small Markdown file changelog.d/.md with its entry, so parallel PRs never touch the same file. The new bin/news script (plain POSIX sh, so it works on Linux, the BSDs and macOS) creates a fragment in $VISUAL/$EDITOR from a template encouraging longer, explanatory entries (`bin/news 123`), previews the pending release section (`bin/news preview`), and folds the fragments, sorted by number, into a new "# Release " section of CHANGELOG.md (`bin/news collect`). A new portable top-level Makefile wraps it as `make news N=123`, `make changelog-preview`, `make changelog` and `make release`, the last of which also builds the documentation via docs/Makefile; that gains an explicit `html` rule, as its Sphinx-generated catch-all pattern rule is GNU make only. The news target passes N and TEXT to bin/news through the environment ("$$N", "$$TEXT"), so Markdown backticks and quotes in an entry reach the script literally instead of being re-parsed by the shell. The pending entry for the #223 regression tests, previously in the "Upcoming release" section, has been moved to changelog.d/223.md, and the PR template, contributing and release-process docs updated. --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- CHANGELOG.md | 5 -- Makefile | 33 ++++++++ bin/news | 132 +++++++++++++++++++++++++++++++ changelog.d/223.md | 1 + changelog.d/985.md | 1 + changelog.d/README.md | 51 ++++++++++++ docs/Makefile | 7 +- docs/contributing.rst | 15 ++++ docs/release-process.rst | 10 ++- 10 files changed, 246 insertions(+), 11 deletions(-) create mode 100644 Makefile create mode 100755 bin/news create mode 100644 changelog.d/223.md create mode 100644 changelog.d/985.md create mode 100644 changelog.d/README.md diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 73f482297..004b284d3 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -7,6 +7,6 @@ Fixes #(issue) # Checklist (delete if not relevant): - [ ] I have added tests that prove my fix is effective or that my feature works -- [ ] I have updated CHANGELOG.md +- [ ] I have added a changelog fragment to `changelog.d/` (see `changelog.d/README.md`) - [ ] I have made corresponding changes to user documentation for new features - [ ] I have made corresponding changes to library documentation for API changes diff --git a/CHANGELOG.md b/CHANGELOG.md index 4bb036f7f..8238aa4bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,3 @@ -# **Upcoming release** - -- #223 Add regression tests for restructuring and patchedast with `elif(` written without a space (@mcepl) - - # Release 1.16.0 - #859 Fix `find_definition`/Rename not resolving `async def` methods called via `self` (@gadievron) diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..74b3841f4 --- /dev/null +++ b/Makefile @@ -0,0 +1,33 @@ +# Maintenance tasks for rope. +# +# Changelog entries live as individual fragments in changelog.d/ +# (one file per PR, see changelog.d/README.md) and are only merged +# into CHANGELOG.md at release time, so that pull requests do not +# keep conflicting on the top of CHANGELOG.md. The real work is done +# by bin/news; this Makefile is kept portable (GNU make, BSD make). + +NEWS = ./bin/news + +.PHONY: help news changelog-preview changelog docs release + +help: + @echo "make news N= write a changelog fragment in \$$EDITOR" + @echo " (or bin/news )" + @echo "make changelog-preview show the pending changelog entries" + @echo "make changelog fold fragments into CHANGELOG.md" + @echo "make docs build the HTML documentation" + @echo "make release changelog + docs" + +news: + @$(NEWS) add "$$N" "$$TEXT" + +changelog-preview: + @$(NEWS) preview + +changelog: + @$(NEWS) collect + +docs: + cd docs && $(MAKE) html + +release: changelog docs diff --git a/bin/news b/bin/news new file mode 100755 index 000000000..217762c08 --- /dev/null +++ b/bin/news @@ -0,0 +1,132 @@ +#!/bin/sh +# Manage changelog fragments in changelog.d/ (see changelog.d/README.md). +# +# bin/news [add] [text] create changelog.d/.md, +# in $VISUAL/$EDITOR unless text given +# bin/news preview show the pending release section +# bin/news collect fold the fragments into CHANGELOG.md +# +# Deliberately plain POSIX sh, so it works the same on Linux, the BSDs +# and macOS. + +set -eu + +cd "$(dirname "$0")/.." +NEWS_DIR=changelog.d +CHANGELOG=CHANGELOG.md + +die() { + printf '%s\n' "$*" >&2 + exit 1 +} + +usage() { + sed -n '4,7s/^# \{0,1\}//p' "$0" >&2 + exit 2 +} + +version() { + v=$(sed -n "s/^version *= *['\"]\([^'\"]*\)['\"].*/\1/p" pyproject.toml) + [ -n "$v" ] || die "Cannot find version in pyproject.toml" + printf '%s\n' "$v" +} + +# Fragment file names, sorted by issue number. +fragments() { + for f in "$NEWS_DIR"/[0-9]*.md; do + [ -e "$f" ] && basename "$f" + done | sort -n | sed "s|^|$NEWS_DIR/|" +} + +template() { + cat <"$tmp" + else + template "$n" >"$tmp" + # unquoted on purpose: allow e.g. EDITOR='code --wait' + ${VISUAL:-${EDITOR:-vi}} "$tmp" + fi + + # drop comments and leading (and, via $(), trailing) blank lines + entry=$(grep -v -E '^#( |$)' "$tmp" | sed -e '/./,$!d') + rest=$(printf '%s' "$entry" | sed -e "s/^- #$n//" | tr -d '[:space:]') + [ -n "$rest" ] || die "Empty entry, nothing written." + + printf '%s\n' "$entry" >"$f" + printf 'Created %s:\n' "$f" + cat "$f" +} + +cmd_preview() { + files=$(fragments) + [ -n "$files" ] || die "No fragments in $NEWS_DIR/" + printf '# Release %s\n\n' "$(version)" + # shellcheck disable=SC2086 # file names are digits and dashes only + cat $files +} + +cmd_collect() { + v=$(version) + files=$(fragments) + [ -n "$files" ] || die "No fragments in $NEWS_DIR/" + ! grep -q -x -F "# Release $v" "$CHANGELOG" || + die "$CHANGELOG already has 'Release $v';" \ + "bump version in pyproject.toml first" + + tmp=$(mktemp "${TMPDIR:-/tmp}/changelog.XXXXXX") + trap 'rm -f "$tmp"' EXIT + { + cmd_preview + echo + cat "$CHANGELOG" + } >"$tmp" + cat "$tmp" >"$CHANGELOG" + # shellcheck disable=SC2086 + rm -f $files + git add -A "$NEWS_DIR" "$CHANGELOG" + echo "$CHANGELOG updated for $v; review and commit." +} + +[ $# -ge 1 ] || usage +case $1 in + add) shift; cmd_add "$@" ;; + preview) cmd_preview ;; + collect) cmd_collect ;; + -h | --help | help) usage ;; + [0-9]*) cmd_add "$@" ;; + *) usage ;; +esac diff --git a/changelog.d/223.md b/changelog.d/223.md new file mode 100644 index 000000000..0d98c1bac --- /dev/null +++ b/changelog.d/223.md @@ -0,0 +1 @@ +- #223 Add regression tests for restructuring and patchedast with `elif(` written without a space (@mcepl) diff --git a/changelog.d/985.md b/changelog.d/985.md new file mode 100644 index 000000000..3453ea80f --- /dev/null +++ b/changelog.d/985.md @@ -0,0 +1 @@ +- #985 create new system for combining CHANGELOG.md from individual snippets for each PR (@mcepl) diff --git a/changelog.d/README.md b/changelog.d/README.md new file mode 100644 index 000000000..c958a198b --- /dev/null +++ b/changelog.d/README.md @@ -0,0 +1,51 @@ +# Changelog fragments + +Instead of editing `CHANGELOG.md` directly (which makes nearly +every pull request conflict with every other one), each pull +request adds a small file to this directory. The fragments are +merged into `CHANGELOG.md` by `make changelog` (part of +`make release`) when a new version is released. + +## How to add an entry + +Create a file named after the issue or pull request number, e.g. +`changelog.d/1234.md`. If you need more than one fragment for the +same number, add a suffix: `1234-docs.md`. The file name **must** +start with a digit and end in `.md`; other files (like this one) +are ignored. + +The easiest way is to run + +```sh +bin/news 1234 # or: make news N=1234 +``` + +which opens `$VISUAL`/`$EDITOR` (falling back to `vi`) with a +template and saves the result as `changelog.d/1234.md`. Leaving +the entry empty aborts without creating anything. + +The content is one or more Markdown list items, in the same style +as the existing `CHANGELOG.md`. Please don't limit yourself to a +terse one-liner: explain what changed, why, and what users of +rope may notice. Wrap long lines and indent continuation lines by +two spaces: + +```markdown +- #1234 Fix renaming of keyword arguments when inlining a method + whose body conflicts with names in the host scope; previously + rope produced `__0__from_lang=` in the result. (@yourname) +``` + +Several related issues may be listed together, e.g. +`- #826, #940 Keep star imports …`. + +For scripts, `bin/news 1234 'Short description (@you)'` (or +`make news N=1234 TEXT='...'`) writes the fragment without +starting an editor. + +Use `bin/news preview` (or `make changelog-preview`) to see what +the next release section will look like. + +`bin/news` is a plain POSIX shell script and the `Makefile` is +portable, so this works with both GNU and BSD make, on Linux, the +BSDs and macOS. diff --git a/docs/Makefile b/docs/Makefile index d4bb2cbb9..b44be6e48 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -12,7 +12,12 @@ BUILDDIR = _build help: @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) -.PHONY: help Makefile +.PHONY: help html Makefile + +# Explicit rule, so that `make html` (used by the top-level +# Makefile) works with BSD make too, which lacks pattern rules. +html: + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). diff --git a/docs/contributing.rst b/docs/contributing.rst index 796699986..ead26066c 100644 --- a/docs/contributing.rst +++ b/docs/contributing.rst @@ -112,6 +112,21 @@ Follow the instructions on GitHub_ on how to setup Git and fork the `python-rope/rope`_ repository. Once your changes are ready, send a `pull request`_ for review. +Please do not edit ``CHANGELOG.md`` directly. Instead, add a small +changelog fragment named after the issue or pull request number to the +``changelog.d/`` directory. Running ``bin/news 1234`` (or +``make news N=1234``) opens your ``$EDITOR`` with a template and +creates ``changelog.d/1234.md``, e.g.:: + + - #1234 Fix renaming of keyword arguments when inlining a method + whose body conflicts with names in the host scope. (@yourname) + +Longer entries explaining what changed and why are welcome. + +The fragments are collected into ``CHANGELOG.md`` at release time, which +avoids merge conflicts between pull requests. See +``changelog.d/README.md`` for details. + Programming Style ----------------- diff --git a/docs/release-process.rst b/docs/release-process.rst index 87c356864..46da53eed 100644 --- a/docs/release-process.rst +++ b/docs/release-process.rst @@ -11,10 +11,12 @@ Release ------- 1. Ensure tickets assigned to Milestones are up to date -2. Update ``CHANGELOG.md`` -3. Close milestone -4. Increment version number in ``pyproject.toml`` -5. `git commit && git push` +2. Close milestone +3. Increment version number in ``pyproject.toml`` +4. Run ``make release``: it folds the fragments from ``changelog.d/`` + into ``CHANGELOG.md`` (``git rm``-ing the fragments) and builds the + documentation; ``make changelog-preview`` shows the result in advance +5. Review ``CHANGELOG.md``, then ``git commit -a && git push`` 6. Tag the release with the tag annotation containing the release information, ``python bin/tag-release.py`` 7. Create Github Release From d5a8021ded3913d728855f804087b065af677547 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C4=9Bj=20Cepl?= Date: Mon, 30 Nov 2026 12:17:17 +0100 Subject: [PATCH 2/3] Rewrite bin/news in Python so it works on Windows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As @lieryan pointed out in the review, requiring a POSIX shell (and make) just to write a changelog entry would raise the barrier for contributors on Windows, who so far only needed make for building the documentation, and even there Sphinx provides make.bat. Replace the sh script with bin/news.py, which uses only the standard library and keeps the same commands (add, preview, collect). It looks for an editor in $VISUAL, $EDITOR and git's core.editor, falling back to Notepad on Windows and vi elsewhere, writes LF line endings everywhere, and numbers duplicate fragments 1234-2.md, 1234-3.md, … instead of using a timestamp. The contributor documentation now leads with simply creating changelog.d/.md in any editor, offers `python bin/news.py ` as a helper, and mentions the make targets only as a shortcut; these remain for the release manager and call the script via $(PYTHON). The #985 fragment is expanded accordingly. --- Makefile | 9 +- bin/news | 132 ----------------------- bin/news.py | 220 +++++++++++++++++++++++++++++++++++++++ changelog.d/985.md | 8 +- changelog.d/README.md | 55 +++++----- docs/contributing.rst | 7 +- docs/release-process.rst | 2 + 7 files changed, 270 insertions(+), 163 deletions(-) delete mode 100755 bin/news create mode 100755 bin/news.py diff --git a/Makefile b/Makefile index 74b3841f4..c2ff2e389 100644 --- a/Makefile +++ b/Makefile @@ -4,15 +4,18 @@ # (one file per PR, see changelog.d/README.md) and are only merged # into CHANGELOG.md at release time, so that pull requests do not # keep conflicting on the top of CHANGELOG.md. The real work is done -# by bin/news; this Makefile is kept portable (GNU make, BSD make). +# by bin/news.py, which contributors can also run directly +# (`python bin/news.py 1234`, works on Windows); this Makefile is +# only a convenience and is kept portable (GNU make, BSD make). -NEWS = ./bin/news +PYTHON ?= python3 +NEWS = $(PYTHON) bin/news.py .PHONY: help news changelog-preview changelog docs release help: @echo "make news N= write a changelog fragment in \$$EDITOR" - @echo " (or bin/news )" + @echo " (or python bin/news.py )" @echo "make changelog-preview show the pending changelog entries" @echo "make changelog fold fragments into CHANGELOG.md" @echo "make docs build the HTML documentation" diff --git a/bin/news b/bin/news deleted file mode 100755 index 217762c08..000000000 --- a/bin/news +++ /dev/null @@ -1,132 +0,0 @@ -#!/bin/sh -# Manage changelog fragments in changelog.d/ (see changelog.d/README.md). -# -# bin/news [add] [text] create changelog.d/.md, -# in $VISUAL/$EDITOR unless text given -# bin/news preview show the pending release section -# bin/news collect fold the fragments into CHANGELOG.md -# -# Deliberately plain POSIX sh, so it works the same on Linux, the BSDs -# and macOS. - -set -eu - -cd "$(dirname "$0")/.." -NEWS_DIR=changelog.d -CHANGELOG=CHANGELOG.md - -die() { - printf '%s\n' "$*" >&2 - exit 1 -} - -usage() { - sed -n '4,7s/^# \{0,1\}//p' "$0" >&2 - exit 2 -} - -version() { - v=$(sed -n "s/^version *= *['\"]\([^'\"]*\)['\"].*/\1/p" pyproject.toml) - [ -n "$v" ] || die "Cannot find version in pyproject.toml" - printf '%s\n' "$v" -} - -# Fragment file names, sorted by issue number. -fragments() { - for f in "$NEWS_DIR"/[0-9]*.md; do - [ -e "$f" ] && basename "$f" - done | sort -n | sed "s|^|$NEWS_DIR/|" -} - -template() { - cat <"$tmp" - else - template "$n" >"$tmp" - # unquoted on purpose: allow e.g. EDITOR='code --wait' - ${VISUAL:-${EDITOR:-vi}} "$tmp" - fi - - # drop comments and leading (and, via $(), trailing) blank lines - entry=$(grep -v -E '^#( |$)' "$tmp" | sed -e '/./,$!d') - rest=$(printf '%s' "$entry" | sed -e "s/^- #$n//" | tr -d '[:space:]') - [ -n "$rest" ] || die "Empty entry, nothing written." - - printf '%s\n' "$entry" >"$f" - printf 'Created %s:\n' "$f" - cat "$f" -} - -cmd_preview() { - files=$(fragments) - [ -n "$files" ] || die "No fragments in $NEWS_DIR/" - printf '# Release %s\n\n' "$(version)" - # shellcheck disable=SC2086 # file names are digits and dashes only - cat $files -} - -cmd_collect() { - v=$(version) - files=$(fragments) - [ -n "$files" ] || die "No fragments in $NEWS_DIR/" - ! grep -q -x -F "# Release $v" "$CHANGELOG" || - die "$CHANGELOG already has 'Release $v';" \ - "bump version in pyproject.toml first" - - tmp=$(mktemp "${TMPDIR:-/tmp}/changelog.XXXXXX") - trap 'rm -f "$tmp"' EXIT - { - cmd_preview - echo - cat "$CHANGELOG" - } >"$tmp" - cat "$tmp" >"$CHANGELOG" - # shellcheck disable=SC2086 - rm -f $files - git add -A "$NEWS_DIR" "$CHANGELOG" - echo "$CHANGELOG updated for $v; review and commit." -} - -[ $# -ge 1 ] || usage -case $1 in - add) shift; cmd_add "$@" ;; - preview) cmd_preview ;; - collect) cmd_collect ;; - -h | --help | help) usage ;; - [0-9]*) cmd_add "$@" ;; - *) usage ;; -esac diff --git a/bin/news.py b/bin/news.py new file mode 100755 index 000000000..0a760ac49 --- /dev/null +++ b/bin/news.py @@ -0,0 +1,220 @@ +#!/usr/bin/env python3 +"""Manage changelog fragments in changelog.d/ (see changelog.d/README.md). + + python bin/news.py [add] [text] create changelog.d/.md, + in an editor unless text given + python bin/news.py preview show the pending release section + python bin/news.py collect fold the fragments into CHANGELOG.md + +Only the standard library is used, so this works anywhere rope's +test suite does, including Windows. +""" + +import os +import re +import shlex +import shutil +import subprocess +import sys +import tempfile +from pathlib import Path + +ROOT = Path(__file__).resolve().parent.parent +NEWS_DIR = ROOT / "changelog.d" +CHANGELOG = ROOT / "CHANGELOG.md" +PYPROJECT = ROOT / "pyproject.toml" + +# The first line ends with a space, so that the cursor lands after it. +TEMPLATE = "- #{n} \n" + """ +# Describe your change for the changelog of the next release. +# +# The entry is a Markdown list item starting with the issue/PR +# number; wrap long lines and indent continuation lines by two +# spaces. Do not hesitate to write more than a one-liner: say +# what changed, why, and what users of rope may notice. +# Credit yourself at the end, e.g. (@your-github-handle). +# +# Lines starting with '# ' are removed. Leaving the entry empty +# aborts. +""" + + +class NewsError(Exception): + pass + + +def read_text(path): + return path.read_text(encoding="utf-8") + + +def write_text(path, text): + # Keep LF line endings on Windows too. + with open(path, "w", encoding="utf-8", newline="\n") as f: + f.write(text) + + +def version(): + match = re.search( + r"""^version\s*=\s*['"]([^'"]+)['"]""", read_text(PYPROJECT), re.M + ) + if match is None: + raise NewsError(f"Cannot find version in {PYPROJECT.name}") + return match.group(1) + + +def fragment_key(path): + """Sort by number, then 1234.md, 1234-2.md, …, 1234-10.md""" + number = re.match(r"\d+", path.stem).group() + suffix = path.stem[len(number) :] + return int(number), len(suffix), suffix + + +def fragments(): + """Return the fragment files, sorted by issue/PR number""" + return sorted( + ( + path + for path in NEWS_DIR.glob("*.md") + if path.name[0].isdigit() and path.is_file() + ), + key=fragment_key, + ) + + +def fragment_path(n): + path = NEWS_DIR / f"{n}.md" + suffix = 2 + while path.exists(): + path = NEWS_DIR / f"{n}-{suffix}.md" + suffix += 1 + return path + + +def editor_command(): + """Return the user's editor as an argument list + + Like git, prefer $VISUAL and $EDITOR, then git's own editor + (core.editor), and fall back to notepad or vi. + """ + editor = os.environ.get("VISUAL") or os.environ.get("EDITOR") + if not editor and shutil.which("git"): + try: + editor = subprocess.run( + ["git", "var", "GIT_EDITOR"], + cwd=ROOT, + capture_output=True, + text=True, + check=True, + ).stdout.strip() + except subprocess.CalledProcessError: + editor = None + if not editor: + editor = "notepad" if os.name == "nt" else "vi" + if os.name == "nt": + # Keep backslashes in Windows paths, just strip the quotes. + return [arg.strip('"') for arg in shlex.split(editor, posix=False)] + return shlex.split(editor) + + +def clean_entry(text): + """Drop comment lines and surrounding blank lines""" + lines = [ + line.rstrip() for line in text.splitlines() if not re.match(r"#( |$)", line) + ] + return "\n".join(lines).strip("\n") + + +def cmd_add(n, text=None): + if not re.fullmatch(r"\d+", n): + raise NewsError(f"Not an issue/PR number: {n!r}") + + if text: + entry = f"- #{n} {text}" + else: + # Edit in a private directory, so that an aborted edit + # leaves nothing behind and the editor still sees a *.md + # file name. + with tempfile.TemporaryDirectory(prefix="news.") as tmpdir: + tmp = Path(tmpdir) / f"{n}.md" + write_text(tmp, TEMPLATE.format(n=n)) + try: + subprocess.run([*editor_command(), str(tmp)], check=True) + except (OSError, subprocess.CalledProcessError) as err: + raise NewsError(f"Running the editor failed: {err}") from err + entry = read_text(tmp) + entry = clean_entry(entry) + + if not re.sub(rf"^- #{n}", "", entry).strip(): + raise NewsError("Empty entry, nothing written.") + + path = fragment_path(n) + write_text(path, entry + "\n") + print(f"Created {path.relative_to(ROOT).as_posix()}:") + print(entry) + + +def release_section(): + files = fragments() + if not files: + raise NewsError(f"No fragments in {NEWS_DIR.name}/") + entries = "".join(read_text(path).rstrip("\n") + "\n" for path in files) + return f"# Release {version()}\n\n{entries}", files + + +def cmd_preview(): + section, _ = release_section() + sys.stdout.write(section) + + +def cmd_collect(): + section, files = release_section() + heading = section.splitlines()[0] + changelog = read_text(CHANGELOG) + if heading in changelog.splitlines(): + raise NewsError( + f"{CHANGELOG.name} already has {heading!r}; " + f"bump version in {PYPROJECT.name} first" + ) + + write_text(CHANGELOG, f"{section}\n{changelog}") + for path in files: + path.unlink() + try: + subprocess.run( + ["git", "add", "-A", NEWS_DIR.name, CHANGELOG.name], + cwd=ROOT, + check=True, + ) + except (OSError, subprocess.CalledProcessError) as err: + print(f"Warning: git add failed: {err}", file=sys.stderr) + print(f"{CHANGELOG.name} updated for {version()}; review and commit.") + + +def usage(): + print(__doc__.split("\n\n")[1], file=sys.stderr) + return 2 + + +def main(argv): + if not argv: + return usage() + command, *args = argv + try: + if command == "add" and 1 <= len(args) <= 2: + cmd_add(*args) + elif command[0].isdigit() and len(args) <= 1: + cmd_add(command, *args) + elif command == "preview" and not args: + cmd_preview() + elif command == "collect" and not args: + cmd_collect() + else: + return usage() + except NewsError as err: + print(err, file=sys.stderr) + return 1 + return 0 + + +if __name__ == "__main__": + sys.exit(main(sys.argv[1:])) diff --git a/changelog.d/985.md b/changelog.d/985.md index 3453ea80f..fd355d9ec 100644 --- a/changelog.d/985.md +++ b/changelog.d/985.md @@ -1 +1,7 @@ -- #985 create new system for combining CHANGELOG.md from individual snippets for each PR (@mcepl) +- #985 Collect changelog entries from per-PR fragments in + `changelog.d/` instead of editing `CHANGELOG.md` directly, so + that pull requests no longer conflict with each other on the + top of the changelog. Contributors add `changelog.d/.md` by + hand or with `python bin/news.py ` (plain Python, so it + works on Windows too); the release manager folds the fragments + into `CHANGELOG.md` with `make changelog`. (@mcepl) diff --git a/changelog.d/README.md b/changelog.d/README.md index c958a198b..126d9c5ca 100644 --- a/changelog.d/README.md +++ b/changelog.d/README.md @@ -3,26 +3,15 @@ Instead of editing `CHANGELOG.md` directly (which makes nearly every pull request conflict with every other one), each pull request adds a small file to this directory. The fragments are -merged into `CHANGELOG.md` by `make changelog` (part of -`make release`) when a new version is released. +merged into `CHANGELOG.md` when a new version is released. ## How to add an entry Create a file named after the issue or pull request number, e.g. -`changelog.d/1234.md`. If you need more than one fragment for the -same number, add a suffix: `1234-docs.md`. The file name **must** -start with a digit and end in `.md`; other files (like this one) -are ignored. - -The easiest way is to run - -```sh -bin/news 1234 # or: make news N=1234 -``` - -which opens `$VISUAL`/`$EDITOR` (falling back to `vi`) with a -template and saves the result as `changelog.d/1234.md`. Leaving -the entry empty aborts without creating anything. +`changelog.d/1234.md`, with any text editor. If you need more than +one fragment for the same number, add a suffix: `1234-docs.md`. +The file name **must** start with a digit and end in `.md`; other +files (like this one) are ignored. The content is one or more Markdown list items, in the same style as the existing `CHANGELOG.md`. Please don't limit yourself to a @@ -39,13 +28,31 @@ two spaces: Several related issues may be listed together, e.g. `- #826, #940 Keep star imports …`. -For scripts, `bin/news 1234 'Short description (@you)'` (or -`make news N=1234 TEXT='...'`) writes the fragment without -starting an editor. +## Helper script + +Alternatively, run -Use `bin/news preview` (or `make changelog-preview`) to see what -the next release section will look like. +```sh +python bin/news.py 1234 +``` -`bin/news` is a plain POSIX shell script and the `Makefile` is -portable, so this works with both GNU and BSD make, on Linux, the -BSDs and macOS. +which opens your editor (`$VISUAL`, `$EDITOR` or git's +`core.editor`, falling back to Notepad on Windows and `vi` +elsewhere) with a template and saves the result as +`changelog.d/1234.md`. Leaving the entry empty aborts without +creating anything. `python bin/news.py 1234 'Short description +(@you)'` writes the fragment without starting an editor, and +`python bin/news.py preview` shows what the next release section +will look like. + +The script needs nothing but Python, so it works on Windows as +well as on Linux, the BSDs and macOS. If you have `make`, the +same is available as `make news N=1234 [TEXT='...']` and +`make changelog-preview`. + +## At release time + +The release manager runs `make changelog` (part of `make +release`) or `python bin/news.py collect`, which folds the +fragments, sorted by number, into a new `# Release ` +section of `CHANGELOG.md` and removes them. diff --git a/docs/contributing.rst b/docs/contributing.rst index ead26066c..e9b202030 100644 --- a/docs/contributing.rst +++ b/docs/contributing.rst @@ -114,9 +114,10 @@ Follow the instructions on GitHub_ on how to setup Git and fork the Please do not edit ``CHANGELOG.md`` directly. Instead, add a small changelog fragment named after the issue or pull request number to the -``changelog.d/`` directory. Running ``bin/news 1234`` (or -``make news N=1234``) opens your ``$EDITOR`` with a template and -creates ``changelog.d/1234.md``, e.g.:: +``changelog.d/`` directory, e.g. ``changelog.d/1234.md``. You can +create it with any text editor, or run ``python bin/news.py 1234``, +which opens your editor with a template. The fragment is a Markdown +list item:: - #1234 Fix renaming of keyword arguments when inlining a method whose body conflicts with names in the host scope. (@yourname) diff --git a/docs/release-process.rst b/docs/release-process.rst index 46da53eed..4ca2ce323 100644 --- a/docs/release-process.rst +++ b/docs/release-process.rst @@ -16,6 +16,8 @@ Release 4. Run ``make release``: it folds the fragments from ``changelog.d/`` into ``CHANGELOG.md`` (``git rm``-ing the fragments) and builds the documentation; ``make changelog-preview`` shows the result in advance + (without ``make``: ``python bin/news.py collect`` and + ``python bin/news.py preview``) 5. Review ``CHANGELOG.md``, then ``git commit -a && git push`` 6. Tag the release with the tag annotation containing the release information, ``python bin/tag-release.py`` From 143e1f8cf33a7c83062fa9cafdd88839835f10b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C4=9Bj=20Cepl?= Date: Tue, 1 Dec 2026 10:38:31 +0100 Subject: [PATCH 3/3] Rework changelog tooling after review: one name, less docs Address the review of the changelog workflow. The script is now bin/changelog.py and everything uses "changelog" rather than a mix of "news" and "fragment". It uses argparse for a standard, short help, writes files with Path.write_text(), and reads its template from changelog.d/TEMPLATE.md, which contributors can also copy by hand and which is the only copy of the style guide. Collecting strips the template's HTML comment and inserts the new release above the first "# Release" heading, so that the new warning header at the top of CHANGELOG.md stays in place. The contributor documentation (docs/contributing.rst and changelog.d/README.md) is cut down to what a contributor needs: the script first, the manual alternative second, and the warning against editing CHANGELOG.md last. The design rationale moved to a comment in the script and implementation details (editor detection, Windows) are no longer described. The release checklist now collects the changelog as step 1, so that it can be checked against the milestone. The Makefile stays as a thin convenience wrapper. "make changelog" is now an alias for the CHANGELOG.md file target, which depends on the pending entries; as collecting removes them, any entry left forces a rebuild regardless of timestamps. --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- CHANGELOG.md | 5 ++ Makefile | 44 +++++----- bin/{news.py => changelog.py} | 134 +++++++++++++++---------------- changelog.d/985.md | 12 ++- changelog.d/README.md | 69 +++++----------- changelog.d/TEMPLATE.md | 15 ++++ docs/contributing.rst | 19 ++--- docs/release-process.rst | 21 +++-- 9 files changed, 148 insertions(+), 173 deletions(-) rename bin/{news.py => changelog.py} (54%) create mode 100644 changelog.d/TEMPLATE.md diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 004b284d3..f1c5e43fe 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -7,6 +7,6 @@ Fixes #(issue) # Checklist (delete if not relevant): - [ ] I have added tests that prove my fix is effective or that my feature works -- [ ] I have added a changelog fragment to `changelog.d/` (see `changelog.d/README.md`) +- [ ] I have added a changelog entry to `changelog.d/` (see `changelog.d/README.md`) - [ ] I have made corresponding changes to user documentation for new features - [ ] I have made corresponding changes to library documentation for API changes diff --git a/CHANGELOG.md b/CHANGELOG.md index 8238aa4bc..8230eb963 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ + + # Release 1.16.0 - #859 Fix `find_definition`/Rename not resolving `async def` methods called via `self` (@gadievron) diff --git a/Makefile b/Makefile index c2ff2e389..6b558716b 100644 --- a/Makefile +++ b/Makefile @@ -1,34 +1,34 @@ -# Maintenance tasks for rope. -# -# Changelog entries live as individual fragments in changelog.d/ -# (one file per PR, see changelog.d/README.md) and are only merged -# into CHANGELOG.md at release time, so that pull requests do not -# keep conflicting on the top of CHANGELOG.md. The real work is done -# by bin/news.py, which contributors can also run directly -# (`python bin/news.py 1234`, works on Windows); this Makefile is -# only a convenience and is kept portable (GNU make, BSD make). +# Maintenance tasks for rope; a thin wrapper around +# bin/changelog.py and the Sphinx documentation. Kept portable +# between GNU make and BSD make. PYTHON ?= python3 -NEWS = $(PYTHON) bin/news.py +CHANGELOG = $(PYTHON) bin/changelog.py +ENTRIES != ls changelog.d/[0-9]*.md 2>/dev/null || true -.PHONY: help news changelog-preview changelog docs release +.PHONY: help changelog-add changelog-preview changelog docs release FORCE help: - @echo "make news N= write a changelog fragment in \$$EDITOR" - @echo " (or python bin/news.py )" - @echo "make changelog-preview show the pending changelog entries" - @echo "make changelog fold fragments into CHANGELOG.md" - @echo "make docs build the HTML documentation" - @echo "make release changelog + docs" + @echo "make changelog-add N= [TEXT=...] add changelog.d/N.md" + @echo "make changelog-preview show the next release section" + @echo "make changelog fold entries into CHANGELOG.md" + @echo "make docs build the HTML documentation" + @echo "make release changelog + docs" -news: - @$(NEWS) add "$$N" "$$TEXT" +changelog-add: + @$(CHANGELOG) add "$$N" "$$TEXT" changelog-preview: - @$(NEWS) preview + @$(CHANGELOG) preview -changelog: - @$(NEWS) collect +changelog: CHANGELOG.md + +# Collecting removes the entries, so any entry left means +# CHANGELOG.md is out of date, whatever the timestamps say. +CHANGELOG.md: $(ENTRIES) $(ENTRIES:%=FORCE) + @$(CHANGELOG) collect + +FORCE: docs: cd docs && $(MAKE) html diff --git a/bin/news.py b/bin/changelog.py similarity index 54% rename from bin/news.py rename to bin/changelog.py index 0a760ac49..843822b6c 100755 --- a/bin/news.py +++ b/bin/changelog.py @@ -1,15 +1,7 @@ #!/usr/bin/env python3 -"""Manage changelog fragments in changelog.d/ (see changelog.d/README.md). - - python bin/news.py [add] [text] create changelog.d/.md, - in an editor unless text given - python bin/news.py preview show the pending release section - python bin/news.py collect fold the fragments into CHANGELOG.md - -Only the standard library is used, so this works anywhere rope's -test suite does, including Windows. -""" +"""Manage changelog entries in changelog.d/ (see changelog.d/README.md).""" +import argparse import os import re import shlex @@ -20,26 +12,18 @@ from pathlib import Path ROOT = Path(__file__).resolve().parent.parent -NEWS_DIR = ROOT / "changelog.d" +ENTRIES_DIR = ROOT / "changelog.d" +TEMPLATE = ENTRIES_DIR / "TEMPLATE.md" CHANGELOG = ROOT / "CHANGELOG.md" PYPROJECT = ROOT / "pyproject.toml" -# The first line ends with a space, so that the cursor lands after it. -TEMPLATE = "- #{n} \n" + """ -# Describe your change for the changelog of the next release. -# -# The entry is a Markdown list item starting with the issue/PR -# number; wrap long lines and indent continuation lines by two -# spaces. Do not hesitate to write more than a one-liner: say -# what changed, why, and what users of rope may notice. -# Credit yourself at the end, e.g. (@your-github-handle). -# -# Lines starting with '# ' are removed. Leaving the entry empty -# aborts. -""" - - -class NewsError(Exception): +# Entries live in changelog.d/.md (or -.md), one or +# more per pull request, and are only folded into CHANGELOG.md at +# release time, so that pull requests do not all conflict on the +# top of CHANGELOG.md. + + +class ChangelogError(Exception): pass @@ -48,9 +32,7 @@ def read_text(path): def write_text(path, text): - # Keep LF line endings on Windows too. - with open(path, "w", encoding="utf-8", newline="\n") as f: - f.write(text) + path.write_text(text, encoding="utf-8", newline="\n") def version(): @@ -58,34 +40,34 @@ def version(): r"""^version\s*=\s*['"]([^'"]+)['"]""", read_text(PYPROJECT), re.M ) if match is None: - raise NewsError(f"Cannot find version in {PYPROJECT.name}") + raise ChangelogError(f"Cannot find version in {PYPROJECT.name}") return match.group(1) -def fragment_key(path): +def entry_key(path): """Sort by number, then 1234.md, 1234-2.md, …, 1234-10.md""" number = re.match(r"\d+", path.stem).group() suffix = path.stem[len(number) :] return int(number), len(suffix), suffix -def fragments(): - """Return the fragment files, sorted by issue/PR number""" +def entry_files(): + """Return the entry files, sorted by issue/PR number""" return sorted( ( path - for path in NEWS_DIR.glob("*.md") + for path in ENTRIES_DIR.glob("*.md") if path.name[0].isdigit() and path.is_file() ), - key=fragment_key, + key=entry_key, ) -def fragment_path(n): - path = NEWS_DIR / f"{n}.md" +def entry_path(n): + path = ENTRIES_DIR / f"{n}.md" suffix = 2 while path.exists(): - path = NEWS_DIR / f"{n}-{suffix}.md" + path = ENTRIES_DIR / f"{n}-{suffix}.md" suffix += 1 return path @@ -117,47 +99,49 @@ def editor_command(): def clean_entry(text): - """Drop comment lines and surrounding blank lines""" - lines = [ - line.rstrip() for line in text.splitlines() if not re.match(r"#( |$)", line) - ] + """Drop HTML comments, trailing whitespace and blank lines around""" + text = re.sub(r"", "", text, flags=re.S) + lines = [line.rstrip() for line in text.splitlines()] return "\n".join(lines).strip("\n") def cmd_add(n, text=None): if not re.fullmatch(r"\d+", n): - raise NewsError(f"Not an issue/PR number: {n!r}") + raise ChangelogError(f"Not an issue/PR number: {n!r}") if text: entry = f"- #{n} {text}" else: + template = read_text(TEMPLATE).replace("NNNN", n) # Edit in a private directory, so that an aborted edit # leaves nothing behind and the editor still sees a *.md # file name. - with tempfile.TemporaryDirectory(prefix="news.") as tmpdir: + with tempfile.TemporaryDirectory(prefix="changelog.") as tmpdir: tmp = Path(tmpdir) / f"{n}.md" - write_text(tmp, TEMPLATE.format(n=n)) + write_text(tmp, template) try: subprocess.run([*editor_command(), str(tmp)], check=True) except (OSError, subprocess.CalledProcessError) as err: - raise NewsError(f"Running the editor failed: {err}") from err + raise ChangelogError(f"Running the editor failed: {err}") from err entry = read_text(tmp) + if clean_entry(entry) == clean_entry(template): + raise ChangelogError("Entry left unchanged, nothing written.") entry = clean_entry(entry) if not re.sub(rf"^- #{n}", "", entry).strip(): - raise NewsError("Empty entry, nothing written.") + raise ChangelogError("Empty entry, nothing written.") - path = fragment_path(n) + path = entry_path(n) write_text(path, entry + "\n") print(f"Created {path.relative_to(ROOT).as_posix()}:") print(entry) def release_section(): - files = fragments() + files = entry_files() if not files: - raise NewsError(f"No fragments in {NEWS_DIR.name}/") - entries = "".join(read_text(path).rstrip("\n") + "\n" for path in files) + raise ChangelogError(f"No entries in {ENTRIES_DIR.name}/") + entries = "".join(clean_entry(read_text(path)) + "\n" for path in files) return f"# Release {version()}\n\n{entries}", files @@ -171,17 +155,20 @@ def cmd_collect(): heading = section.splitlines()[0] changelog = read_text(CHANGELOG) if heading in changelog.splitlines(): - raise NewsError( + raise ChangelogError( f"{CHANGELOG.name} already has {heading!r}; " f"bump version in {PYPROJECT.name} first" ) - write_text(CHANGELOG, f"{section}\n{changelog}") + # Keep whatever precedes the first release (the header). + match = re.search(r"^# Release ", changelog, re.M) + pos = match.start() if match else len(changelog) + write_text(CHANGELOG, f"{changelog[:pos]}{section}\n{changelog[pos:]}") for path in files: path.unlink() try: subprocess.run( - ["git", "add", "-A", NEWS_DIR.name, CHANGELOG.name], + ["git", "add", "-A", ENTRIES_DIR.name, CHANGELOG.name], cwd=ROOT, check=True, ) @@ -190,27 +177,34 @@ def cmd_collect(): print(f"{CHANGELOG.name} updated for {version()}; review and commit.") -def usage(): - print(__doc__.split("\n\n")[1], file=sys.stderr) - return 2 +def parse_args(argv): + parser = argparse.ArgumentParser(prog="changelog.py", description=__doc__) + commands = parser.add_subparsers(dest="command", required=True) + add = commands.add_parser( + "add", + help="add changelog.d/N.md (the default command)", + description="Add changelog.d/N.md, in an editor unless TEXT is given.", + ) + add.add_argument("n", metavar="N", help="issue or pull request number") + add.add_argument("text", metavar="TEXT", nargs="?", help="the entry text") + commands.add_parser("preview", help="show the next release section") + commands.add_parser("collect", help="fold the entries into CHANGELOG.md") + # `changelog.py 1234 ...` is short for `changelog.py add 1234 ...` + if argv and argv[0].isdigit(): + argv = ["add", *argv] + return parser.parse_args(argv) def main(argv): - if not argv: - return usage() - command, *args = argv + args = parse_args(argv) try: - if command == "add" and 1 <= len(args) <= 2: - cmd_add(*args) - elif command[0].isdigit() and len(args) <= 1: - cmd_add(command, *args) - elif command == "preview" and not args: + if args.command == "add": + cmd_add(args.n, args.text) + elif args.command == "preview": cmd_preview() - elif command == "collect" and not args: - cmd_collect() else: - return usage() - except NewsError as err: + cmd_collect() + except ChangelogError as err: print(err, file=sys.stderr) return 1 return 0 diff --git a/changelog.d/985.md b/changelog.d/985.md index fd355d9ec..7bce3abf7 100644 --- a/changelog.d/985.md +++ b/changelog.d/985.md @@ -1,7 +1,5 @@ -- #985 Collect changelog entries from per-PR fragments in - `changelog.d/` instead of editing `CHANGELOG.md` directly, so - that pull requests no longer conflict with each other on the - top of the changelog. Contributors add `changelog.d/.md` by - hand or with `python bin/news.py ` (plain Python, so it - works on Windows too); the release manager folds the fragments - into `CHANGELOG.md` with `make changelog`. (@mcepl) +- #985 Collect changelog entries from `changelog.d/` instead of + editing `CHANGELOG.md` directly, so that pull requests no longer + conflict with each other on the top of the changelog. Add yours + with `python bin/changelog.py `, see `changelog.d/README.md`. + (@mcepl) diff --git a/changelog.d/README.md b/changelog.d/README.md index 126d9c5ca..55866b847 100644 --- a/changelog.d/README.md +++ b/changelog.d/README.md @@ -1,58 +1,31 @@ -# Changelog fragments +# Changelog entries -Instead of editing `CHANGELOG.md` directly (which makes nearly -every pull request conflict with every other one), each pull -request adds a small file to this directory. The fragments are -merged into `CHANGELOG.md` when a new version is released. +Every pull request adds its changelog entry as a file in this +directory, named after the issue or pull request number, e.g. +`changelog.d/1234.md`. The entries are collected into +`CHANGELOG.md` when a new version is released. ## How to add an entry -Create a file named after the issue or pull request number, e.g. -`changelog.d/1234.md`, with any text editor. If you need more than -one fragment for the same number, add a suffix: `1234-docs.md`. -The file name **must** start with a digit and end in `.md`; other -files (like this one) are ignored. - -The content is one or more Markdown list items, in the same style -as the existing `CHANGELOG.md`. Please don't limit yourself to a -terse one-liner: explain what changed, why, and what users of -rope may notice. Wrap long lines and indent continuation lines by -two spaces: - -```markdown -- #1234 Fix renaming of keyword arguments when inlining a method - whose body conflicts with names in the host scope; previously - rope produced `__0__from_lang=` in the result. (@yourname) -``` - -Several related issues may be listed together, e.g. -`- #826, #940 Keep star imports …`. +Run -## Helper script +```sh +python bin/changelog.py 1234 +``` -Alternatively, run +It opens a text editor with `TEMPLATE.md` and saves the result +as `changelog.d/1234.md`. To use a different editor than the one +it picks, set the `VISUAL` or `EDITOR` environment variable. Or +give the text on the command line and skip the editor: ```sh -python bin/news.py 1234 +python bin/changelog.py 1234 'Fix renaming of keyword arguments (@yourname)' ``` -which opens your editor (`$VISUAL`, `$EDITOR` or git's -`core.editor`, falling back to Notepad on Windows and `vi` -elsewhere) with a template and saves the result as -`changelog.d/1234.md`. Leaving the entry empty aborts without -creating anything. `python bin/news.py 1234 'Short description -(@you)'` writes the fragment without starting an editor, and -`python bin/news.py preview` shows what the next release section -will look like. - -The script needs nothing but Python, so it works on Windows as -well as on Linux, the BSDs and macOS. If you have `make`, the -same is available as `make news N=1234 [TEXT='...']` and -`make changelog-preview`. - -## At release time - -The release manager runs `make changelog` (part of `make -release`) or `python bin/news.py collect`, which folds the -fragments, sorted by number, into a new `# Release ` -section of `CHANGELOG.md` and removes them. +Alternatively, copy `TEMPLATE.md` to `changelog.d/1234.md` and +edit it by hand. `TEMPLATE.md` also describes how to write the +entry. + +`python bin/changelog.py preview` shows how the entries will look +in the next release; `python bin/changelog.py --help` lists all +commands. diff --git a/changelog.d/TEMPLATE.md b/changelog.d/TEMPLATE.md new file mode 100644 index 000000000..8191c969b --- /dev/null +++ b/changelog.d/TEMPLATE.md @@ -0,0 +1,15 @@ +- #NNNN Describe what changed, why, and what users of rope may + notice. (@your-github-handle) + + diff --git a/docs/contributing.rst b/docs/contributing.rst index e9b202030..9c402df37 100644 --- a/docs/contributing.rst +++ b/docs/contributing.rst @@ -112,21 +112,14 @@ Follow the instructions on GitHub_ on how to setup Git and fork the `python-rope/rope`_ repository. Once your changes are ready, send a `pull request`_ for review. -Please do not edit ``CHANGELOG.md`` directly. Instead, add a small -changelog fragment named after the issue or pull request number to the -``changelog.d/`` directory, e.g. ``changelog.d/1234.md``. You can -create it with any text editor, or run ``python bin/news.py 1234``, -which opens your editor with a template. The fragment is a Markdown -list item:: +Every pull request should add a changelog entry, a file in +``changelog.d/`` named after the issue or pull request number. To +create it, run:: - - #1234 Fix renaming of keyword arguments when inlining a method - whose body conflicts with names in the host scope. (@yourname) + python bin/changelog.py 1234 -Longer entries explaining what changed and why are welcome. - -The fragments are collected into ``CHANGELOG.md`` at release time, which -avoids merge conflicts between pull requests. See -``changelog.d/README.md`` for details. +See ``changelog.d/README.md`` for details. Please do not edit +``CHANGELOG.md`` directly. Programming Style diff --git a/docs/release-process.rst b/docs/release-process.rst index 4ca2ce323..b3f386129 100644 --- a/docs/release-process.rst +++ b/docs/release-process.rst @@ -10,19 +10,16 @@ Pre-Release Release ------- -1. Ensure tickets assigned to Milestones are up to date -2. Close milestone -3. Increment version number in ``pyproject.toml`` -4. Run ``make release``: it folds the fragments from ``changelog.d/`` - into ``CHANGELOG.md`` (``git rm``-ing the fragments) and builds the - documentation; ``make changelog-preview`` shows the result in advance - (without ``make``: ``python bin/news.py collect`` and - ``python bin/news.py preview``) -5. Review ``CHANGELOG.md``, then ``git commit -a && git push`` -6. Tag the release with the tag annotation containing the release information, +1. Increment version number in ``pyproject.toml`` and collect the + changelog entries: ``python bin/changelog.py collect`` +2. Ensure tickets assigned to Milestones are up to date and match + ``CHANGELOG.md`` +3. Close milestone +4. ``git commit -a && git push`` +5. Tag the release with the tag annotation containing the release information, ``python bin/tag-release.py`` -7. Create Github Release -8. Publish release announcements to GitHub Discussions +6. Create Github Release +7. Publish release announcements to GitHub Discussions Release Schedule