Skip to content

Commit

Permalink
Add towncrier command. Ref jaraco/skeleton#83.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Jun 21, 2023
1 parent a2a4da4 commit 5fe0fe8
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
7 changes: 7 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
v7.20.0
=======

* Added ``towncrier`` module for invoking towncrier with
a version calculated based on towncrier news fragments
in service of jaraco/skeleton#83.

v7.19.0
=======

Expand Down
18 changes: 17 additions & 1 deletion jaraco/develop/towncrier.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import collections
import pathlib
import subprocess
import sys


import autocommand
from jaraco.vcs import repo
from jaraco.versioning import semver


_release_bumps = collections.defaultdict(
Expand Down Expand Up @@ -44,3 +47,16 @@ def get_version():
'...'
"""
return repo().get_next_version(release_kind())


@autocommand.autocommand(__name__)
def run(command, *args):
cmd = (
sys.executable,
'-m',
'towncrier',
command,
'--version',
semver(get_version()),
) + args
subprocess.check_call(cmd)

0 comments on commit 5fe0fe8

Please sign in to comment.