bumpversion

0.6.0 · maintenance · verified Sat Apr 11

bumpversion is a command-line utility for managing semantic versioning in software projects. It automates the process of updating all version strings across various files in your source code, creating commits, and tagging releases in version control systems like Git or Mercurial. The project itself is in maintenance mode, with its official GitHub repository recommending actively maintained forks like `bump2version` and `bump-my-version` for new users. The current PyPI version is 0.6.0, with an infrequent release cadence.

Warnings

Install

Quickstart

This quickstart demonstrates how to set up `bumpversion` for a simple project, initialize a version file and a configuration file, and then perform a version bump. It includes Git commands as `bumpversion` integrates closely with Git for committing and tagging. The `current_version` in `.bumpversion.cfg` must match the version string found in your files.

# 1. Create a project directory and navigate into it
mkdir my_project && cd my_project

# 2. Initialize a Git repository (optional, but recommended for bumpversion)
git init

# 3. Create an initial version file (e.g., 'VERSION' or 'my_package/__init__.py')
echo "0.1.0" > VERSION

# 4. Create a .bumpversion.cfg file
cat <<EOF > .bumpversion.cfg
[bumpversion]
current_version = 0.1.0
commit = True
tag = True

[bumpversion:file:VERSION]
EOF

# 5. Make an initial commit
git add .bumpversion.cfg VERSION
git commit -m "Initial project setup"

# 6. Bump the patch version
bumpversion patch

# Verify the change
cat VERSION
git log --oneline -2

view raw JSON →