peritus / bumpversion

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

should be able to increment version without --current-version and without --new-version #152

Closed tedder closed 7 years ago

tedder commented 7 years ago

I'd like to be able to arbitrarily increment the version. For instance, this works:

bumpversion --dry-run --verbose --current-version 0.0.1 patch setup.py 

I'd like this to work:

bumpversion --dry-run --verbose --current-version 0.0.1 patch setup.py 
[detects version is 0.0.1]
[bumps to version 0.0.2]

Can you confirm that isn't possible now?

alphapseudo commented 7 years ago

You should be able to accomplish this with the .bumpversion.cfg file.

Create project/.bumpversion.cfg

[bumpversion]
commit = True
tag = True
current_version = 0.0.1

[bumpversion:file:setup.py]

e.g. project/setup.py

#!/usr/bin/env python

from distutils.core import setup

setup(name='Example',
      version='0.0.1',
      description='Bumpversion',
      author='John Doe',
      author_email='John.Doe@python.net',
      packages=['distutils', 'distutils.command'],
     )

Now issuing bumpversion patch in your project root will detect and bump 0.0.1 --> 0.0.2 accordingly.

tedder commented 7 years ago

I guess that's the straight-up RTFM. I didn't try it with a .bumpversion.cfg, so it's my fault. Thanks for replying.