FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
cookiecutter-robust-python/scripts/get-release-notes.py at main · robust-python/cookiecutter-robust-python · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
robust-python
/
cookiecutter-robust-python
Public
Notifications
You must be signed in to change notification settings
Fork
5
Star
23
Code
Issues
5
Pull requests
0
Discussions
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
cookiecutter-robust-python
/
scripts
/
get-release-notes.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
50 lines (39 loc) · 1.26 KB
Breadcrumbs
cookiecutter-robust-python
/
scripts
/
get-release-notes.py
Copy path
File metadata and controls
50 lines (39 loc) · 1.26 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# /// script
# requires-python = ">=3.10"
# dependencies = [
# "cookiecutter",
# "cruft",
# "python-dotenv",
# "typer",
# ]
# ///
"""Script responsible for extracting release notes for the cookiecutter-robust-python template."""
import
sys
from
pathlib
import
Path
from
typing
import
Annotated
from
typing
import
Optional
import
typer
from
util
import
get_latest_release_notes
cli
:
typer
.
Typer
=
typer
.
Typer
()
DEFAULT_RELEASE_NOTES_PATH
:
Path
=
Path
(
"release_notes.md"
)
@
cli
.
callback
(
invoke_without_command
=
True
)
def
main
(
path
:
Annotated
[
Optional
[
Path
],
typer
.
Argument
(
help
=
f"Path to write release notes (default:
{
DEFAULT_RELEASE_NOTES_PATH
}
)"
)
]
=
None
,
)
->
None
:
"""Extract release notes for the current version.
Uses commitizen to generate changelog entries for unreleased changes.
Must be run before tagging the release.
"""
try
:
output_path
:
Path
=
path
if
path
else
DEFAULT_RELEASE_NOTES_PATH
release_notes
:
str
=
get_latest_release_notes
()
output_path
.
write_text
(
release_notes
)
typer
.
secho
(
f"Release notes written to
{
output_path
}
"
,
fg
=
"green"
)
except
Exception
as
error
:
typer
.
secho
(
f"error:
{
error
}
"
,
fg
=
"red"
)
sys
.
exit
(
1
)
if
__name__
==
"__main__"
:
cli
()
Back
|
FazBrowse Home
|
New Git URL