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

[API] Possible default replace? #156

Open henryiii opened 4 years ago

henryiii commented 4 years ago

The current search always requires a replace if non-standard:

search = stuff{current_version}stuff
replace = stuff{new_version}stuff

If you don't always define replace (to exactly the same thing as search except with {current_version} replaced by {new_version}, then you can't run bump version more than once. Couldn't the default for replace instead be search except with {current_version} replaced by {new_version}? Then it would almost never need to be specified.

Just a thought, sorry if it's come up before!

florisla commented 3 years ago

This looks very appealing to me.

90% of search should not need a custom replace in this way.

The other 10% is when you want to include dynamic things in the replace like environment variables or dates.