From 3b162675e605e49fc8fa9e2317327dd0f079a159 Mon Sep 17 00:00:00 2001 From: Gil Forcada Codinachs Date: Sat, 25 Nov 2023 20:11:42 +0100 Subject: [PATCH 1/2] feat: save the changes for later use This way `zest.releaser` can append these changes on the release commit message and later this can be automatically extracted from that commit to generate a GitHub release. --- src/zestreleaser/towncrier/__init__.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/zestreleaser/towncrier/__init__.py b/src/zestreleaser/towncrier/__init__.py index a591654..6e5bbfc 100644 --- a/src/zestreleaser/towncrier/__init__.py +++ b/src/zestreleaser/towncrier/__init__.py @@ -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( From 217d606c9ef80f6a2f428c9d2c10124a46489077 Mon Sep 17 00:00:00 2001 From: Gil Forcada Codinachs Date: Sat, 25 Nov 2023 20:17:07 +0100 Subject: [PATCH 2/2] Add news entry --- news/25.feature | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 news/25.feature diff --git a/news/25.feature b/news/25.feature new file mode 100644 index 0000000..5a10c19 --- /dev/null +++ b/news/25.feature @@ -0,0 +1,3 @@ +Save the changes internally so that `zest.releaser` +can use it later on during the release process. +[gforcada]