Skip to main content

Bumps package version numbers

Project description

bump

Bumps package versions.

Example

By default, running bump in a directory with a setup.py will bump the “patch” number in place. If a pyproject.toml file with a [project].version field is also present, it will be updated with the same version number:

$ bump
1.0.1
$ git diff setup.py
─────────────────────────────────────────────────
modified: setup.py
─────────────────────────────────────────────────
@ setup.py:6 @ from setuptools import setup

setup(
    name='bump',
-    version='1.0.0',
+    version='1.0.1',
    description='Bumps package version numbers',
    long_description=open('README.rst').read(),
    license='MIT',

Conveniently bump will also return the new version number, so you can use it after running the command, for example:

$ export VERSION=`bump`
$ echo "The new version is $VERSION"
The new version is 1.0.1

Options

The bump command can also bump the major or minor version numbers, or set the pre-release identifier or local version segment:

$ bump --help
Usage: bump [OPTIONS] [INPUT] [OUTPUT]

Options:
  -M, --major     Bump major number. Ex.: 1.2.3 -> 2.2.3
  -m, --minor     Bump minor number. Ex.: 1.2.3 -> 1.3.3
  -p, --patch     Bump patch number. Ex.: 1.2.3 -> 1.2.4
  -r, --reset     Reset subversions. Ex.: Major bump from 1.2.3 will be 2.0.0
                  instead of 2.2.3
  --pre TEXT      Set the pre-release identifier
  --local TEXT    Set the local version segment
  --canonicalize  Canonicalize the new version
  --help          Show this message and exit.

The –reset option should be used alongside with minor or major bump.

You can configure these options by setting them in a .bump or setup.cfg configuration file as well, so you don’t have to specify them every time:

$ cat .bump
[bump]
input = some_directory/__file__.py
minor = true
patch = false
reset = true

pyproject.toml Support

bump also supports pyproject.toml files following PEP 621 standards. When both setup.py and pyproject.toml exist in the same directory, both files will be updated with the same version number automatically.

The tool looks for the version in the [project].version field:

[project]
name = "my-package"
version = "1.0.0"

When you run bump, both files will be synchronized:

$ bump
1.0.1
Updated pyproject.toml

This makes bump compatible with modern Python packaging tools like uv, poetry, and flit, while maintaining backward compatibility with traditional setup.py-only projects.

Project details


Download files

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

Source Distribution

bump-1.4.0.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bump-1.4.0-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file bump-1.4.0.tar.gz.

File metadata

  • Download URL: bump-1.4.0.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for bump-1.4.0.tar.gz
Algorithm Hash digest
SHA256 1b58e1182660c282e332ddae1083a4c01ca47ec8d0f35a303acddca2d113bae8
MD5 75ac6bd764cd5265e8b16d0f3f0acc8d
BLAKE2b-256 226811cb6c4df2d6583c532208dae3a09ed4281f3a942ca03a912b48acd66295

See more details on using hashes here.

Provenance

The following attestation bundles were made for bump-1.4.0.tar.gz:

Publisher: release.yml on di/bump

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bump-1.4.0-py3-none-any.whl.

File metadata

  • Download URL: bump-1.4.0-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for bump-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 34fe2eea2c4c80ca040d368c9789e8042b9d646922d55ef91157253c941366e9
MD5 db075ecfe66999e56b392a5fe20f59fe
BLAKE2b-256 cc91f00b300285a0a7f3783fbbc0046c5d8d91bc11f8b6c7da03c3f4235165b1

See more details on using hashes here.

Provenance

The following attestation bundles were made for bump-1.4.0-py3-none-any.whl:

Publisher: release.yml on di/bump

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page