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

Multi-line `replace` doesn't work for lines starting with `#` #235

Open Penacillin opened 2 years ago

Penacillin commented 2 years ago

NOTE: This is a duplicate of https://github.com/peritus/bumpversion/issues/199 . Just adding this here since that's not maintained anymore.

Wanted to bring that same issue up here, as it still seems relevant

kdeldycke commented 2 years ago

Here is how it might be fixed using a custom parser as in ConfigParser(interpolation=ExtendedInterpolation()): https://docs.python.org/3/library/configparser.html?highlight=configfile#customizing-parser-behaviour

sanderr commented 1 year ago

If I understand correctly, there is actually already a workaround for this, though it is not documented yet. I added documentation in #261, which is still in review.