Skip to content

Commit

Permalink
Fix the bump_version script's changelog mutation
Browse files Browse the repository at this point in the history
  • Loading branch information
i80and committed Sep 23, 2019
1 parent 4ab2c38 commit 2b40474
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion HACKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ To release snooty, do the following:
in the `dist` directory, and check the _This is a pre-release_ checkbox.

If there is an error, use `git reset --hard <previous_commit_hash>` to revert any
commits that might have been made.
commits that might have been made, and `git tag --delete v<version>` to remove the
tag if it was created.

## Problem Areas

Expand Down
2 changes: 1 addition & 1 deletion tools/bump_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def release_changelog(version: str, text: str) -> str:

def replace(match: Match[str]) -> str:
unreleased_block = match["unreleased"].strip()
return f"\n## [Unreleased]\n\n## [{version}] - {date_string}\n\n{unreleased_block}\n"
return f"\n## [Unreleased]\n\n## [v{version}] - {date_string}\n\n{unreleased_block}\n"

result = CHANGELOG_UNRELEASED_PAT.sub(replace, text)
if not result:
Expand Down
2 changes: 1 addition & 1 deletion tools/test_bump_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def test_release_changelog() -> None:
- No longer create spurious diagnostics about including apiargs artifacts and `hash.rst`."""

assert (
release_changelog("v0.1.13", TEST_INPUT1)
release_changelog("0.1.13", TEST_INPUT1)
== f"""# Changelog
## [Unreleased]
Expand Down

0 comments on commit 2b40474

Please sign in to comment.