Skip to content

Dynamicize previous version in whatsnew template. #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 9, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions run_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
This saves the maintainer the effort of going through the Mercurial log
when researching a change.

This article explains the new features in Python {version}, compared to 3.10.
This article explains the new features in Python {version}, compared to {prev_version}.

For full details, see the :ref:`changelog <changelog>`.

Expand Down Expand Up @@ -848,10 +848,12 @@ def maybe_prepare_new_master_branch(db: DbfilenameShelf) -> None:
with cd(db["git_repo"]):
release_mod.bump(new_release)

prev_branch = f"{release_tag.major}.{release_tag.minor}"
new_branch = f"{release_tag.major}.{int(release_tag.minor)+1}"
whatsnew_file = f"Doc/whatsnew/{new_branch}"
with cd(db["git_repo"]), open(whatsnew_file, "w") as f:
f.write(WHATS_NEW_TEMPLATE.format(version=new_branch))
f.write(WHATS_NEW_TEMPLATE.format(version=new_branch,
prev_version=prev_branch))

subprocess.check_call(
["git", "add", whatsnew_file],
Expand Down