@@ -47,7 +47,7 @@ def commit(cls, message: str, current_version: str, new_version: str, extra_args
47
47
env ["BUMPVERSION_NEW_VERSION" ] = new_version
48
48
49
49
try :
50
- subprocess .check_output ([* cls ._COMMIT_COMMAND , f .name , * extra_args ], env = env )
50
+ subprocess .run ([* cls ._COMMIT_COMMAND , f .name , * extra_args ], env = env , capture_output = True , check = True )
51
51
except subprocess .CalledProcessError as exc :
52
52
err_msg = f"Failed to run { exc .cmd } : return code { exc .returncode } , output: { exc .output } "
53
53
logger .exception (err_msg )
@@ -59,7 +59,7 @@ def commit(cls, message: str, current_version: str, new_version: str, extra_args
59
59
def is_usable (cls ) -> bool :
60
60
"""Is the VCS implementation usable."""
61
61
try :
62
- result = subprocess .run (cls ._TEST_USABLE_COMMAND , check = True )
62
+ result = subprocess .run (cls ._TEST_USABLE_COMMAND , check = True , capture_output = True )
63
63
return result .returncode == 0
64
64
except (FileNotFoundError , PermissionError , NotADirectoryError , subprocess .CalledProcessError ):
65
65
return False
@@ -172,8 +172,12 @@ def latest_tag_info(cls, tag_pattern: str) -> SCMInfo:
172
172
"""Return information about the latest tag."""
173
173
try :
174
174
# git-describe doesn't update the git-index, so we do that
175
- subprocess .run (["git" , "update-index" , "--refresh" ], check = True )
175
+ subprocess .run (["git" , "update-index" , "--refresh" , "-q" ], capture_output = True )
176
+ except subprocess .CalledProcessError as e :
177
+ logger .debug ("Error when running git update-index: %s" , e .stderr )
178
+ return SCMInfo (tool = cls )
176
179
180
+ try :
177
181
# get info about the latest tag in git
178
182
# TODO: This only works if the tag name is prefixed with `v`.
179
183
# Should allow for the configured format for the tag name.
@@ -188,8 +192,8 @@ def latest_tag_info(cls, tag_pattern: str) -> SCMInfo:
188
192
]
189
193
result = subprocess .run (git_cmd , text = True , check = True , capture_output = True )
190
194
describe_out = result .stdout .strip ().split ("-" )
191
- except subprocess .CalledProcessError :
192
- logger .debug ("Error when running git describe" )
195
+ except subprocess .CalledProcessError as e :
196
+ logger .debug ("Error when running git describe: %s" , e . stderr )
193
197
return SCMInfo (tool = cls )
194
198
195
199
info = SCMInfo ()
0 commit comments