This is a simple tool for automated versioning with Git. It assumes you branch name contains major and minor version parts in a standardized way. The default is at the end of the branch name, but you can custom this with --branch_regex. It also assumes you use git tags in "<version_prefix><major>.<minor>.<build>" scheme for releases. For instance here's an example branch structure looks something like this:
* release/1.0 release/1.5 release/2.0
Then some example tags for the above branch structure:
1.0.0 1.0.1 1.0.2 1.5.0 2.0.0
While currently on release/1.0 with the latest tag being
1.0.2 as seen above. If you run
git_bump_version without the HEAD commit being tagged, it will tag the local and remote HEAD commit with
1.0.3 as well as output
1.0.3 to stdout. Alternatively, you can run
git_bump_version --dont_tag to just output
1.0.3 without doing any tagging. The default version prefix is empty though these can be customized via command line options (i.e. a common version prefix is "
v" resulting in versions like
Installs like a regular PyPI package.
- Simply run in your cloned directory:
python setup.py installOR
- Grab the latest version from the public PyPI:
pip install git-bump-version
This is a command line tool so development is pretty straight forward.
The additional test requirements are
mock which can both be installed with
pip. After installing these packages, simply run
nosetests in the directory where you cloned this repo and it will run the tests.