Skip to main content

Easy version bumping

Project description

ebump

PyPI Tests

Easy version bumping CLI tool for python projects.

Key features

  • Simple and intuitive CLI for version bumping.
  • Automatic detection of version field in pyproject.toml.
  • Pattern-based configuration that allows to change version in multiple files at once.

[!NOTE] This is an opinionated tool, it assumes a specific versioning scheme: MAJOR.MINOR.PATCH[-TAG[NUMBER]], e.g., 1.2.3, 1.2.3-beta0, 1.2.3-alpha5, 1.2.3-rc2. Supported tags are alpha, beta, dev, rc (release candidate), and final. The final tag is implicit when no tag is present.

Quick showcase

> ebump             # 1.0.0                         Shows current version (same as `uv version --short`)
> ebump patch       # 1.0.0 -> 1.0.1                Bump patch
> ebump minor       # 1.0.1 -> 1.1.0                Bump minor
> ebump major       # 1.5.4 -> 2.0.0                Bump major
> ebump minor beta  # 1.0.0 -> 1.1.0-beta0          Bump minor and add beta tag
> ebump tag         # 1.0.0-beta0 -> 1.0.0-beta1    Bump current tag number
> ebump alpha       # 1.0.0-alpha4 -> 1.0.0-alpha5  Bump tag number if already at tag
> ebump beta        # 1.0.0-alpha5 -> 1.0.0-beta0   Bump to tag if not already at that tag
> ebump tag beta    # 1.0.0-alpha5 -> 1.0.0-beta0   Same as 'ebump beta'
> ebump tag beta    # 1.0.0-beta0 -> 1.0.0-beta1    Same as 'ebump beta'
> ebump final       # 1.0.0-rc2 -> 1.0.0            Bump to final
> ebump final       # 1.0.0 -> 1.0.0                If already at final do nothing (ensures final release)

Setting specific versions

> ebump --set 1.2.3         # 1.0.0 -> 1.2.3        Set specific version
> ebump --set 1.2.3 --force # 5.0.0 -> 1.2.3        Force set specific version (even if it's a downgrade). Use with caution!

Bad examples:

> ebump minor alpha beta    # Error: You can only specify one part to bump and/or one tag
> ebump patch minor         # Error: You can only specify one part to bump
> ebump alpha beta          # Error: You can only specify one tag to bump

# If current version has no tag
> ebump tag                 # Error: No tag found to bump

Any combination that violates the bumping rules will throw an error. E.g., trying to bump alpha while being at beta.

You can also use the --dry-run to see what the new version would be without actually changing it:

> ebump minor --dry-run  # 1.0.0 -> 1.1.0 (no change to version)

Configuration

If you only maintain a simple project with the version only in pyproject.toml, you can use ebump without any configuration. It will automatically detect the version field and update it accordingly.

However, heavily inspired by bumpver, ebump supports pattern-based configuration via pyproject.toml under the [tool.ebump.patterns] section. This allows you to specify different versioning files and patterns for different parts of your project.

[tool.ebump.patterns]
"path/to/__init__.py" = ['^__version__ = "{version}"$']

Installation / Usage

You can use ebump directly via uvx (recommended):

uvx ebump [PARAMS ...]

Or install it via pip:

pip install ebump

Why ebump?

Design differences with bumpver CLI:

  • Bumping final tag doesn't throw errors if the version is already final.

    Useful for CI/CD pipelines where you want to ensure the version is final without worrying about its current state.

  • Bumping one of the main version parts (patch, minor, major) automatically resets any pre-release tag to final unless you explicitly specify a new tag in the same command.

    If you bump the minor version from 1.0.0-beta2, it will become 1.1.0 instead of 1.1.0-beta0. You can still set a pre-release tag in the same command (e.g., ebump minor beta to get 1.1.0-beta0).

  • Simplified CLI with fewer options, focusing on the most common use cases.

  • Can be executed in any directory of the project, root is automatically detected.

What ebump is NOT

  • It is not a replacement for bumpver library. You can still use bumpver library directly for more complex use cases if necessary.
  • It does not aim to cover all use cases. It focuses on simplicity and ease of use.

🤝 Contributing

Contributions are welcome! Please ensure all QA checks and tests pass before opening a pull request.

Acknowledgements

This project is heavily inspired by bumpver.


🚀 Project starter provided by Cookie Pyrate

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

ebump-0.2.1.tar.gz (14.0 kB view details)

Uploaded Source

Built Distribution

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

ebump-0.2.1-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

Details for the file ebump-0.2.1.tar.gz.

File metadata

  • Download URL: ebump-0.2.1.tar.gz
  • Upload date:
  • Size: 14.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.0 {"installer":{"name":"uv","version":"0.11.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for ebump-0.2.1.tar.gz
Algorithm Hash digest
SHA256 eebff3d961ac222ec0ab85d09b444867b977aa0b3fb66c909534199271dd125b
MD5 a5dcdcdadf67ffdf0b3453689cb84a89
BLAKE2b-256 6efeba61a92d3d68ad9cda7f8baf3c3f45a506333ed9d1e809d79868d477800b

See more details on using hashes here.

File details

Details for the file ebump-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: ebump-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 10.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.0 {"installer":{"name":"uv","version":"0.11.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for ebump-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 003829b864d91c97418b0c4ecc213b95c8b04ca7c7fd0b2967068ee03c96d4f4
MD5 a9087144d204e77f9b99d6f0f6dfce06
BLAKE2b-256 4a2183de9b7b485cabf2f47f9085defd9a7b4a7da10175d693993331bfec33ca

See more details on using hashes here.

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