Skip to main content

A CLI utility for bumping the version of any file type

Project description

Bump Anything

Copyright 2019-2023 Caleb Evans
Released under the MIT license

tests Coverage Status

Bump Anything is a command-line utility for incrementing the version It serves as a more-flexible alternative to npm version and similar tools because Bump Anything can handle any arbitrary text file and has built-in support for different types of projects.

Features

  • Bump the version number in any arbitrary file
  • Supports most project types (if no paths are supplied, automatically detects package.json in Node, setup.py or pyproject.toml in Python, style.css for WordPress themes, etc.)

Installation

Bump Anything requires Python 3.9 or newer to run, so please ensure you have it installed.

pip3 install bump-anything

Usage

Bump Anything exposes to your shell a bump-anything command (also aliased to bump). The only required argument is a keyword indicating how you want to increment each version. It can be either major, minor, or patch.

bump major # 1.2.3 -> 2.0.0
bump minor # 1.2.3 -> 1.3.0
bump patch # 1.2.3 -> 1.2.4
bump prerelease # 1.2.3-beta.1 -> 1.2.3-beta.2
bump 2.3.4
bump v2.3.4 # same as `bump 2.3.4`

With this syntax, Bump Anything will do its best to find the relevant files to bump. However, Bump Anything can also accept an optional list of one or more file paths whose versions to bump. Only the first occurrence of the version field in each file will be updated.

bump minor subdir/myfile1.json subdir/myfile2.toml

Git Integration

The bump command will automatically create a tagged commit if the current directory is a Git repository. Only the files that have been modified by bump will be staged.

Custom commit message

You can explicitly specify the commit message with --commit-message or -m. The default is Prepare v<new_version> release. You can use the {new_version} placeholder to represent the new version (without any prefix).

bump --commit-message 'Release v{new_version}' major
bump -m 'Release v{new_version}' major

Custom tag name

You can explicitly specify the tag name with --tag-name or -t (default: v<new_version>). You can use the {new_version} placeholder to represent the new version (without any prefix).

bump --tag-name 'release/{new_version}' patch
bump -t 'release/{new_version}' patch

Disabling committing and/or tagging

If you do not wish for bump to automatically create a commit and tag, you can pass the --no-commit flag (alias: -n):

bump --no-commit minor
bump -n minor

Disabling tagging only

If you wish to disable the automatic tag creation but still create a commit, you can pass the --no-tag flag:

bump --no-tag patch

Auto-Detected Files

  • package.json (Node)
  • package-lock.json (Node)
  • setup.py (Python)
  • pyproject.toml (Python)
  • style.css (WordPress Theme)
  • <cwd name>.php (WordPress Plugin)

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-anything-2.0.0b3.tar.gz (8.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_anything-2.0.0b3-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file bump-anything-2.0.0b3.tar.gz.

File metadata

  • Download URL: bump-anything-2.0.0b3.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for bump-anything-2.0.0b3.tar.gz
Algorithm Hash digest
SHA256 f6bc74c4fd60b35936e4c9b3cca31e82ed4d1a1a3ced6ce19dfbac773ca001a6
MD5 ff19d4662ba0689e7dbbc797f3be51c7
BLAKE2b-256 ad1b9e6019146892d63b8ce65071bb96501364f0ba46609043ff1d563d3ba94b

See more details on using hashes here.

File details

Details for the file bump_anything-2.0.0b3-py3-none-any.whl.

File metadata

File hashes

Hashes for bump_anything-2.0.0b3-py3-none-any.whl
Algorithm Hash digest
SHA256 36b5846af6ec19f023bef90c6a8eded8a276919637a37e239ebe4b5e6c42e1a2
MD5 244e521bcda077eff89926d7e89c9704
BLAKE2b-256 440baacc325689d4b5f758c7be2e9293c738718326cc9b21d6597afa2d75c9eb

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