Skip to main content

Version-bump your software with a single command

Project description

Version-bump your software with a single command!

bumpversion updates all version strings in your source tree by the correct increment, commits that change to git or Mercurial and tags it.



You can download and install the latest version of this software from the Python package index (PyPI) as follows:

pip install --upgrade bumpversion


bumpversion [options] file [file ...]

Config file .bumpversion.cfg

All options can optionally be specified in a config file called .bumpversion.cfg so that once you know how bumpversion needs to be configured for one particular software package, you can run it without specifying options later. You should add that file to VCS so others can also bump versions.

Options on the command line take precedence over those from the config file, which take precedence over those derived from the environment and then from the defaults.

Example .bumpversion.cfg:

current_version = 0.2.9
files =
commit = True
tag = True


file [file ...] / files =

no default value

The files where to search and replace version strings

Command line example:

bumpversion src/VERSION.txt

Config file example:

files = src/VERSION.txt
--bump / bump =

default: patch

Part of the version to increase.

Valid values include those given in the --serialize / --parse option.

Example bumping to 0.6.0:

bumpversion --current-version 0.5.1 --bump minor

Example bumping to 2.0.0:

bumpversion --current-version 1.1.9 --bump major
--current-version / current_version =

no default value

The current version of the software package.


bumpversion --current-version 0.5.1
--new-version / new_version =

no default value

The version of the software after the increment

Example (Go from 0.5.1 directly to 0.6.1):

bumpversion --current-version 0.5.1 --new-version 0.6.1
--parse / parse =


Regular expression (using Python regular expression syntax) on how to find and parse the version string.

Is required to parse all strings produced by --serialize. Named matching groups (“(?P<name>...)”) provide values to use with the --bump flag.

--serialize / serialize =


Template specifying how to serialize the version parts to a version string again.

This is templated using the Python Format String Syntax. Available in the template context are parsed values of the named groups specified in --parse as well as all environment variables (prefixed with $).

--tag / tag = True

default: Don’t create a tag

Whether to create a tag, that is the new version, prefixed with the character “v”. If you are using git, don’t forget to git-push with the --tags flag.

--commit / commit = True

default: Don’t create a commit

Whether to create a commit

--message / message =

default:Bump version: {current_version} → {new_version}

The commit message to use when creating a commit. Only valid when using --commit / commit = True.

This is templated using the Python Format String Syntax. Available in the template context are current_version and new_version as well as all environment variables (prefixed with $).


bumpversion --message 'Jenkins Build {$BUILD_NUMBER}: {new_version}'
-dry-run, -n
Don’t touch any files, just pretend
-h, --help
Print help and exit


Development of this happens on GitHub, patches including tests, documentation are very welcome, as well as bug reports! Also please open an issue if this tool does not support every aspect of bumping versions in your development workflow, as it is intended to be very versatile.



  • If available, use git to learn about current version


  • Mercurial support


  • Only create a tag when it’s requested (thanks @gvangool)


  • Initial public version

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for bumpversion, version 0.2.1
Filename, size File type Python version Upload date Hashes
Filename, size bumpversion-0.2.1.tar.gz (5.9 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page