bump2version icon indicating copy to clipboard operation
bump2version copied to clipboard

Only the serialize part of a version is being stored in the updated files

Open stmlange opened this issue 3 years ago • 0 comments

Hello, thank you for this nice project! I haven't found an issue that describes that problem I have encountered. Essentially it seems that when I run bump2version with a specific version let's say bump2version --verbose --new-version 1.0.0-rc.4 patch the version will get updated properly in .bumpversion.cfg, however the version in relevant configured files (e.g. gradle.properties) will just end up to be the part that I would describe as "parsable" or "serializable" by the config.

From my perspective this is not what I would have expected. Either bumpversion refuses to operate with the --new-version specified (since it's not parsable), or spits out a warning that the --new-version specified is not parsable, but ultimately will set the version in gradle.properties to what has been specified by the command-line arguments.

Example content of .bumpversion.cfg:

[bumpversion]
current_version = 0.9.1
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)
serialize = {major}.{minor}.{patch}
commit = True
message = Update release version from {current_version} to {new_version}

[bumpversion:file:gradle.properties]

and gradle.properties:

version=0.9.1

With bump2version --verbose --new-version 1.0.0-rc.4 patch the .bumpversion.cfg would have current_version = 1.0.0-rc.4 patch and the gradle.properties would indicate version=1.0.0

The easy workaround of course would be to use a parse-thing that accepts all various different versions listed on https://semver.org.

stmlange avatar Jun 22 '22 11:06 stmlange