Bump-Setup
@readwithai - X - blog - machine-aided reading - 📖⚡️🖋️
A command-line tool to bump the version in-place in setup.py or pyproject.yaml for python projects. It can bump major, minor or patch versions.
Most of the value for this is dealing with setup.py. If you only use pyproject.yaml exclusively I might recommend creating your own script since this is a very straight forward task, but this code works for this basic case.
Motivaiton
I got bored of bumping version numbers by hand in files and bumpversion didn't immediately do what I wanted so I made this tool.
Alternatives and prior work
There is a tool called bumpversion which is quite similar but wants to take the files that get modified and also seems to want you to specify the file. bumpver also does something similar to this - and greps through your codebase but the documentation is more than a couple of lines and it seems to require you to maintain separate settings in pyproject.toml - this is meant to 'just work' most of th time.
Installation
You can install bump-setup using pipx:
pip install bump-setup
Usage
To bump the version in setup.py, run the following command:
bump-setup <major|minor|patch>
Examples
bump-setup major # Increments the major version
bump-setup minor # Increments the minor version
bump-setup patch # Increments the patch version
Attribution
This uses the python tree-sitter and tree-sitter-python libraries to modify and parse source code while leaving whitespace intact. I did some vibe coding because I am lazy. I'm not sure it helped much since I then had to fix a bunch of bugs by hand!
About me
I am @readwithai. I create tools for reading, research and agency sometimes using the markdown editor Obsidian.
I also create a stream of tools that are related to carrying out my work. There are various python tools here.
I write about lots of things - including tools like this - on X. My blog is more about reading and research and agency.
Metadata
Release files for bump-setup 1.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| bump_setup-1.4.0.tar.gz | 5.4 kB | Without provenance | Details for bump_setup-1.4.0.tar.gz |
Release files / bump_setup-1.4.0.tar.gz
| Download URL | bump_setup-1.4.0.tar.gz |
|---|---|
| Size | 5.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f1cefc1931badc2b643ea7d19583e28194008377401865cdf83e4e4a21a8815b
|
|
BLAKE2b-256 checksum How to use checksums |
c6ace066e6467e9658b0f10c9e4363c5a5428758f611ed2d6ba7b2d10c2b502b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.3
|
Security for bump-setup 1.4.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.