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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1b58e1182660c282e332ddae1083a4c01ca47ec8d0f35a303acddca2d113bae8
|
|
| MD5 |
75ac6bd764cd5265e8b16d0f3f0acc8d
|
|
| BLAKE2b-256 |
226811cb6c4df2d6583c532208dae3a09ed4281f3a942ca03a912b48acd66295
|
Provenance
The following attestation bundles were made for bump-1.4.0.tar.gz:
Publisher:
release.yml on di/bump
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bump-1.4.0.tar.gz -
Subject digest:
1b58e1182660c282e332ddae1083a4c01ca47ec8d0f35a303acddca2d113bae8 - Sigstore transparency entry: 842992518
- Sigstore integration time:
-
Permalink:
di/bump@6b675cd1c5ea6d89d2f9855d1eceaa959bba3a69 -
Branch / Tag:
refs/tags/1.4.0 - Owner: https://github.com/di
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@6b675cd1c5ea6d89d2f9855d1eceaa959bba3a69 -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
34fe2eea2c4c80ca040d368c9789e8042b9d646922d55ef91157253c941366e9
|
|
| MD5 |
db075ecfe66999e56b392a5fe20f59fe
|
|
| BLAKE2b-256 |
cc91f00b300285a0a7f3783fbbc0046c5d8d91bc11f8b6c7da03c3f4235165b1
|
Provenance
The following attestation bundles were made for bump-1.4.0-py3-none-any.whl:
Publisher:
release.yml on di/bump
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bump-1.4.0-py3-none-any.whl -
Subject digest:
34fe2eea2c4c80ca040d368c9789e8042b9d646922d55ef91157253c941366e9 - Sigstore transparency entry: 842992529
- Sigstore integration time:
-
Permalink:
di/bump@6b675cd1c5ea6d89d2f9855d1eceaa959bba3a69 -
Branch / Tag:
refs/tags/1.4.0 - Owner: https://github.com/di
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@6b675cd1c5ea6d89d2f9855d1eceaa959bba3a69 -
Trigger Event:
release
-
Statement type: