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

per-file configuration #37

Closed peritus closed 10 years ago

peritus commented 10 years ago

Oversimplifying, say I have the following ./package.json that only contains 3-part semver version numbers:

{"version" : "1.2.3"}

and a file Contents/Info.plist that includes the complete version string:

        <key>CFBundleVersion</key>
        <string>1.2.3.19-build1234</string>

I want to bump this so package.json contains 1.2.4 and Contents/Info.plist contains 1.2.4-build1239 afterwards.

It should be possible to use different --serialize formats depending on the file. Also other options, if that makes sense.

peritus commented 10 years ago

Different example, but this is how the config for this could look like:

[bumpversion]
commit = True
tag = True

[file:setup.cfg]
serialize =
  {major}.{minor}.{patch}

[file:README.txt]
serialize =
  {major}.{minor}
  {major}.{minor}.{patch}

[file:BUILDNUMBER]
serialize =
  {major}.{minor}.{patch}+{$USER}+${BUILDNUMBER}

This could supersede the files = option, that would then need to be deprecated eventually.

Also, config files should be migrated automatically.

fizyk commented 10 years ago

It would be good to also be able to define what should get converted into version number during the process per file.

Eg. I'd like to replace 'current version' header in my CHANGELOG.rst file with version number, and not the previous version with new one.

peritus commented 10 years ago

@fizyk Yes, that's indeed a desirable feature! Could you open another issue for that, because I feel this can be implemented independently of per-file config that is discussed here.

fizyk commented 10 years ago

@peritus done: #41

BlaineAtAffirm commented 10 years ago

@peritus From #42. I don't think this pull request would solve the problem I was trying to solve with #42 because I want a very minimal installation. IE no extra config files unless absolutely necessary . I'd prefer command line only.

peritus commented 10 years ago

Implemented, will be part of v0.5.0

peritus commented 10 years ago

This will be part of the upcoming version 0.5 — which you can install by running

sudo pip install https://github.com/peritus/bumpversion/archive/master.zip#egg=bumpversion-dev

I'd appreciate any testing before the release. Please note the new configuration format (documented in the README)