Skip to content
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

Grab changelog #26

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions news/25.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Save the changes internally so that `zest.releaser`
can use it later on during the release process.
[gforcada]
10 changes: 9 additions & 1 deletion src/zestreleaser/towncrier/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,15 @@ def check_towncrier(data, check_sanity=True, do_draft=True):
"Doing dry-run of towncrier to see what would be changed: %s",
utils.format_command(cmd),
)
print(utils.execute_command(cmd))
output = utils.execute_command(cmd)
print(output)
# remove the first two lines that are the release and the underline,
# at least on rst files, and remove the output generated
# by towncrier itself
cleaned_output = [
x for x in output.split('\n')[2:] if not x.startswith('\x1b')
]
data["history_this_release"] = '\n'.join(cleaned_output)
else:
print(
dedent(
Expand Down