c4urself / bump2version

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

Non default search and replace of omitted optional value #160

Open andersonbrands opened 4 years ago

florisla commented 3 years ago

To recap, version v0.0 (0.0-prod) is not properly bumped to v0.1-dev. That's a serious bug.

While investigating your fix, I've found an alternative way to fix this: drop the found_required variable in version_part.py VersionConfig._serialize().

But I'm not sure which of the two approaches is most robust.

I'll add a test case where also the serialization {major} is valid. Then, test all combinations of config file version (0, 0.0 or 0.0-prod) with three different files, each having a longer serialize -- these should bump to 1, 1.0 and 1.0-dev respectively.