@@ -52,7 +52,7 @@ def _render_log(ctx=None, version=None):
5252
5353 cmd = ["towncrier" , "--draft" ]
5454 if version :
55- cmd .extend ([ "--version" , version ])
55+ cmd .append ( f "--name= { version } " ) # Use --name instead of -- version
5656
5757 rendered = subprocess .check_output (cmd ).decode ("utf-8" )
5858 return rendered
@@ -79,7 +79,7 @@ def release(
7979 tag_content = _render_log (ctx , version )
8080 if dry_run :
8181 # Use the correct version when generating the draft
82- ctx .run (f"towncrier --draft --version ={ version } > CHANGELOG.draft.md" )
82+ ctx .run (f"towncrier --draft --name ={ version } > CHANGELOG.draft.md" )
8383 log ("would remove: news/*" )
8484 log ("would remove: CHANGELOG.draft.md" )
8585 log ("would update: pipenv/pipenv.1" )
@@ -88,11 +88,11 @@ def release(
8888 if pre :
8989 log ("generating towncrier draft..." )
9090 # Use the correct version when generating the draft
91- ctx .run (f"towncrier --draft --version ={ version } > CHANGELOG.draft.md" )
91+ ctx .run (f"towncrier --draft --name ={ version } > CHANGELOG.draft.md" )
9292 ctx .run (f"git add { get_version_file (ctx ).as_posix ()} " )
9393 else :
9494 # Use the correct version when generating the changelog
95- ctx .run (f"towncrier --version ={ version } " )
95+ ctx .run (f"towncrier --name ={ version } " )
9696 ctx .run (f"git add CHANGELOG.md news/ { get_version_file (ctx ).as_posix ()} " )
9797 log ("removing changelog draft if present" )
9898 draft_changelog = pathlib .Path ("CHANGELOG.draft.md" )
@@ -200,9 +200,9 @@ def generate_changelog(ctx, commit=False, draft=False):
200200 if draft :
201201 commit = False
202202 log ("Writing draft to file..." )
203- ctx .run (f"towncrier --draft --version ={ version } > CHANGELOG.draft.md" )
203+ ctx .run (f"towncrier --draft --name ={ version } > CHANGELOG.draft.md" )
204204 else :
205- ctx .run (f"towncrier --version ={ version } " )
205+ ctx .run (f"towncrier --name ={ version } " )
206206 if commit :
207207 log ("Committing..." )
208208 ctx .run ("git add CHANGELOG.md" )
0 commit comments