A bit too aggro on the version parsing
See original GitHub issueHey there, love the work you’re doing to keep this alive
I’ve noticed, in my adventures setting up PEX builds for python apps, that any edition of bumpversion (bump2version, advbumpversion, etc) will aggressively match versions from setup.cfg in the listed files. In our case, setup.py is one of those files (normal stuff) and our install_requires can regularly list exact versions of other apps (abnormal but supported). Bumpversion likes to Loki it up in there.
Let’s say my setup.cfg looks like this, a real basic one:
>> cat setup.cfg
[bumpversion]
current_version = 1.0.2
commit = False
tag = False
tag_name = {new_version}
[bumpversion:file:setup.py]
[bumpversion:file:myapp/__init__.py]
And my setup.py looks like this:
from setuptools import setup
__version__ = '1.0.2'
setup(
name='myapp',
version=__version__,
install_requires=[
'Flask==1.0.2'
]
...other useful irrelevant stuff....
)
If I run bumpversion on this project, it bumps the Flask version as well since it’s the same “version”, and causes our CICD to burst into flames.
What would it take to get a config/cli option for “keyword”? Like in setup.cfg, we can say what pattern our version follows, so it would be equally awesome to list a keyword that will always be found on the lines with the version, such as “version”, so bumpversion only replaces versions found on lines that contain the keyword.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:5
I’ve read through the README again, and @jakethedev it seems there is feature that does what you want:
search
andreplace
.I assume this should do the trick:
The golden fleece!
Awesome, thanks so much for looking into it!