Closed timobrembeck closed 2 years ago
Good catch. You can have a look at the function parse_version(version: str) -> typ.Any
.
So you might be able to change that line:
- if latest_version_tag <= cfg.current_version:
+ if version.parse_version(latest_version_tag) <= version.parse_version(cfg.current_version):
The version check in
_update_cfg_from_vcs()
just does a regular string comparison, which does not work when the version numbers are not zero-padded:https://github.com/mbarkhau/bumpver/blob/328ef5c10a8b1f810b4bf3a28d1e5b4e8fdab3aa/src/bumpver/cli.py#L668
E.g., I use the version pattern YYYY.MM.INC0[-TAG] and have multiple local alpha versions which I don't commit to the vcs, but just use to publish dev versions to test.pypi.org. However, this workflow failed today, because the tools thinks that the version from my git tag
2022.3.2
is newer than my local alpha version2022.3.10a0
.Because
"2022.3.9a0" <= "2022.3.2"
isFalse
, the previous build succeeded and"2022.3.10a0" <= "2022.3.2"
isTrue
, it does not allow me to bump my version any further than that and sets the version back to 2022.3.3-alpha, which causes pypi to fail because this version already exists.I would really appreciate any help and would also try to fix this if you point me into the right direction.