mirror of
https://github.com/TECHNOFAB11/bumpver.git
synced 2025-12-12 14:30:09 +01:00
Fix: parameter change from version: str to vinfo: VersionInfo
Using `version: str` meant that version.parse_version_info implicitly
used the "{pycalver}" pattern. The changed parameter vinfo: VersionInfo
now requires the caller (with access to cfg.version_pattern) to provide
the correctly parsed vinfo.
This commit is contained in:
parent
e4a1ea64f0
commit
6d3dc6dfcd
3 changed files with 33 additions and 23 deletions
|
|
@ -223,7 +223,8 @@ def _bump(cfg: config.Config, new_version: str, allow_dirty: bool = False) -> No
|
|||
_assert_not_dirty(_vcs, filepaths, allow_dirty)
|
||||
|
||||
try:
|
||||
rewrite.rewrite(new_version, cfg.file_patterns)
|
||||
new_vinfo = version.parse_version_info(new_version, cfg.version_pattern)
|
||||
rewrite.rewrite(new_vinfo, cfg.file_patterns)
|
||||
except Exception as ex:
|
||||
log.error(str(ex))
|
||||
sys.exit(1)
|
||||
|
|
@ -244,7 +245,8 @@ def _bump(cfg: config.Config, new_version: str, allow_dirty: bool = False) -> No
|
|||
|
||||
|
||||
def _print_diff(cfg: config.Config, new_version: str) -> None:
|
||||
diff: str = rewrite.diff(new_version, cfg.file_patterns)
|
||||
new_vinfo = version.parse_version_info(new_version, cfg.version_pattern)
|
||||
diff: str = rewrite.diff(new_vinfo, cfg.file_patterns)
|
||||
|
||||
if sys.stdout.isatty():
|
||||
for line in diff.splitlines():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue