@@ -141,7 +141,16 @@ def main(force):
141
141
]
142
142
143
143
version_cmd_options = [
144
- click .option ("--version-cmd" , envvar = "RH_VERSION_COMMAND" , help = "The version command" )
144
+ click .option ("--version-cmd" , envvar = "RH_VERSION_COMMAND" , help = "The version command" ),
145
+ ]
146
+
147
+ version_create_tag_options = [
148
+ click .option (
149
+ "--version-create-tag" ,
150
+ envvar = "RH_VERSION_CREATE_TAG" ,
151
+ is_flag = True ,
152
+ help = "Whether to create a tag when bumping the version" ,
153
+ ),
145
154
]
146
155
147
156
@@ -308,18 +317,28 @@ def prep_git(ref, branch, repo, auth, username, git_url):
308
317
@main .command ()
309
318
@add_options (version_spec_options )
310
319
@add_options (version_cmd_options )
320
+ @add_options (version_create_tag_options )
311
321
@add_options (changelog_path_options )
312
322
@add_options (use_changelog_version_options )
313
323
@add_options (python_packages_options )
314
324
@use_checkout_dir ()
315
- def bump_version (version_spec , version_cmd , changelog_path , use_changelog_version , python_packages ):
325
+ def bump_version (
326
+ version_spec ,
327
+ version_cmd ,
328
+ version_create_tag ,
329
+ changelog_path ,
330
+ use_changelog_version ,
331
+ python_packages ,
332
+ ):
316
333
"""Prep git and env variables and bump version"""
317
334
prev_dir = os .getcwd ()
318
335
for python_package in [p .split (":" )[0 ] for p in python_packages ]:
319
336
os .chdir (python_package )
320
337
lib .bump_version (
321
338
version_spec , version_cmd , changelog_path , use_changelog_version = use_changelog_version
322
339
)
340
+ if version_create_tag :
341
+ lib .create_tag ()
323
342
os .chdir (prev_dir )
324
343
325
344
0 commit comments