peritus / bumpversion

Version-bump your software with a single command
https://pypi.python.org/pypi/bumpversion
MIT License
1.5k stars 147 forks source link

Add ability to ignore certain occurances of current_version #76

Closed fizyk closed 9 years ago

fizyk commented 9 years ago

rationale:

In a package, where we set dependencies strictly on given version, I've upgraded to the same version as one of our dependencies have. Unfortunately, version number is being kept in setup.py and bumping version automatically bumps the version of such dependency.

It would be great to ignore strings like 'package-name=={current_version}' from the version bumping process.

peritus commented 9 years ago

Have you tried the search = and replace = options ?

The example in https://github.com/peritus/bumpversion/blob/master/README.rst seems to be exactly what you're asking for:

Given this requirements.txt

Django>=1.5.6,<1.6
MyProject==1.5.6

using this .bumpversion.cfg will ensure only the line containing MyProject will be changed:

[bumpversion]
current_version = 1.5.6

[bumpversion:file:requirements.txt]
search = MyProject=={current_version}
replace = MyProject=={new_version}

— or are you asking for an explicit blacklist of lines not to change because this doesn't solve your problem ?

fizyk commented 9 years ago

You're right. Haven't though about the search parameter at all!