c4urself / bump2version

Version-bump your software with a single command
https://pypi.python.org/pypi/bump2version
MIT License
1.05k stars 135 forks source link

Specifying serialize in arguments does not affect other files #231

Open ecs-jnguyen opened 2 years ago

ecs-jnguyen commented 2 years ago

Description

Hi I have a .bumpversion.cfg with [bumpversion:file:version.txt]. When I use the --serialize cli argument, it correctly writes back to the .bumpversion.cfg but version.txt is using the serialize configuration in the .bumpversion.cfg file.

How To Reproduce Example

Step 1 create .bumpversion.cfg and version.txt

.bumpversion.cfg

[bumpversion]
current_version = 0.8.0
serialize = {major}.{minor}
parse = (?P<major>\d+)\.(?P<minor>\d+)(\.(?P<patch>\d+))?

[bumpversion:file:version.txt]

version.txt:

0.8.0

Run bump2version

$ bump2version patch --serialize "{major}.{minor}.{patch}" --list
current_version=0.8.0
serialize={major}.{minor}
parse=(?P<major>\d+)\.(?P<minor>\d+)(\.(?P<patch>\d+))?
new_version=0.8.1

Results

[bumpversion]
current_version = 0.8.1
serialize = {major}.{minor}
parse = (?P<major>\d+)\.(?P<minor>\d+)(\.(?P<patch>\d+))?

[bumpversion:file:version.txt]

version.txt:

0.8

Summary

After running bump2version with --serialize, we can see that version.txt is using the serialization config from the bumpversion.cfg with the value of 0.8. And we can also see that the version in .bumpversion.cfg is using the serialization from the cli with a value of 0.8.1.