-
-
Notifications
You must be signed in to change notification settings - Fork 503
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #737 from amoffat/develop
Release 2.1.0
- Loading branch information
Showing
7 changed files
with
121 additions
and
35 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import re | ||
import sys | ||
from pathlib import Path | ||
from typing import Iterable | ||
|
||
THIS_DIR = Path(__file__).parent | ||
CHANGELOG = THIS_DIR.parent / "CHANGELOG.md" | ||
|
||
|
||
def fetch_changes(changelog: Path, version: str) -> Iterable[str]: | ||
with open(changelog, "r") as f: | ||
lines = f.readlines() | ||
|
||
found_a_change = False | ||
aggregate = False | ||
for line in lines: | ||
if line.startswith(f"## {version}"): | ||
aggregate = True | ||
|
||
if aggregate: | ||
if line.startswith("-"): | ||
line = re.sub(r"-\s*", "", line).strip() | ||
found_a_change = True | ||
yield line | ||
elif found_a_change: | ||
aggregate = False | ||
|
||
return changes | ||
|
||
|
||
version = sys.argv[1].strip() | ||
changes = fetch_changes(CHANGELOG, version) | ||
if not changes: | ||
exit(1) | ||
|
||
for change in changes: | ||
print("- " + change) |
This file contains 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
This file contains 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
This file contains 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
This file contains 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