Fix incorrect version comparison when updating from vcs tag

This commit is contained in:
Timo Ludwig 2022-03-08 00:44:31 +01:00 committed by mbarkhau
parent defbf89fa8
commit 1fb7e84e91
2 changed files with 13 additions and 2 deletions

View file

@ -1,5 +1,16 @@
# Changelog for https://github.com/mbarkhau/bumpver # Changelog for https://github.com/mbarkhau/bumpver
## BumpVer 2022.1116
- Fix: [incorrect version comparison when updating from vcs tag][gh_i174].
When comparing the updated version to the latest vcs tag,
an insufficient string comparison was used instead of
comparing the parsed versions.
[gh_i174]: https://github.com/mbarkhau/bumpver/issues/174
## BumpVer 2022.1115 ## BumpVer 2022.1115
- Fix: [use default date values][gh_i172]. - Fix: [use default date values][gh_i172].
@ -14,7 +25,7 @@
Thank you [Benjamin Depardon (@bdepardo)][gh_bdepardo] for Thank you [Benjamin Depardon (@bdepardo)][gh_bdepardo] for
finding and reporting this issue. finding and reporting this issue.
[gh_i168]: https://github.com/mbarkhau/bumpver/issues/172 [gh_i172]: https://github.com/mbarkhau/bumpver/issues/172
[gh_bdepardo]: https://github.com/bdepardo [gh_bdepardo]: https://github.com/bdepardo

View file

@ -665,7 +665,7 @@ def _update_cfg_from_vcs(cfg: config.Config, fetch: bool) -> config.Config:
return cfg return cfg
else: else:
latest_version_pep440 = version.to_pep440(latest_version_tag) latest_version_pep440 = version.to_pep440(latest_version_tag)
if latest_version_tag <= cfg.current_version: if version.parse_version(latest_version_tag) <= version.parse_version(cfg.current_version):
# current_version already newer/up-to-date # current_version already newer/up-to-date
return cfg return cfg
else: else: