-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathget-release-notes.py
More file actions
36 lines (26 loc) · 1019 Bytes
/
get-release-notes.py
File metadata and controls
36 lines (26 loc) · 1019 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
"""Script responsible for getting the release notes of the robust-python-demo package."""
import argparse
from pathlib import Path
from util import get_latest_release_notes
RELEASE_NOTES_PATH: Path = Path("body.md")
def main() -> None:
"""Parses args and passes through to bump_version."""
parser: argparse.ArgumentParser = get_parser()
args: argparse.Namespace = parser.parse_args()
release_notes: str = get_latest_release_notes()
path: Path = RELEASE_NOTES_PATH if args.path is None else args.path
path.write_text(release_notes)
def get_parser() -> argparse.ArgumentParser:
"""Creates the argument parser for prepare-release."""
parser: argparse.ArgumentParser = argparse.ArgumentParser(
prog="get-release-notes", usage="python ./scripts/get-release-notes.py"
)
parser.add_argument(
"path",
type=Path,
metavar="PATH",
help="Path the changelog will be written to.",
)
return parser
if __name__ == "__main__":
main()