Zero-padded version parts are not working
Closed this issue · 2 comments
coordt commented
It seems that this fix was removed with some refactoring happened in #112. Tried with version 0.20.1 and the following config parameters:
current_version = "5.06.0"
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
serialize = ["{major}.{minor:02}.{patch}"]
search = "{current_version}"
replace = "{new_version}"
Increasing minor would result in version 5.70.0 which is obviously wrong. Any chances we get this functionality back? Or is there any other possibility to have fixed length version numbers?
Originally posted by @reindlt in #26 (comment)
reindlt commented
Thanks @coordt for opening the issue.
I guess it's related to the same problem as mentioned in #26 (comment) that the version parts are handled as strings. A possible solution has been described here c4urself/bump2version#141 (comment). Does this sound reasonable?
coordt commented
It looks reasonable. I'll look at it today.