Skip to main content
CI https://dl.circleci.com/status-badge/img/gh/dochang/bumplus/tree/master.svg?style=svg Codecov PyPI - License PyPI - Wheel PyPI - Format PyPI - Python Version https://badge.fury.io/py/bumplus.svg Requirements Status Updates Python 3 Say Thanks!

Bumplus is a command line tool to bump your project version.

Prerequisites

Python 3.8, 3.9, 3.10, 3.11, 3.12

Installation

pip install bumplus

Usage

Put a TOML file named .bumplus.toml in the top-level directory of your project. This file at least contains the following content:

version = "<current_version>"

See Configuration for more config options.

Command line

cd <project root dir>
bumplus <new_version>

Use bumplus –help to display the help text.

Python

import bumplus
bp = bumplus.Bumplus('<project root dir>')
bp.bump_version('<new_version>')

Example of .bumplus.toml

version = '1.2.3'

[[files."CHANGELOG.md"]]
search = '''
## Unreleased
'''
replace = '''
## Unreleased

## {{new_version}} - {{utcnow | strftime("%Y-%m-%d")}}
'''

[[files."CHANGELOG.md"]]
search = '''
http://host/changelog/{{old_version}}.html
'''
search = '''
http://host/changelog/{{new_version}}.html
http://host/changelog/{{old_version}}.html
'''

[[files."LICENSE"]]
search = '{{old_version}}'
replace = '{{new_version}}'

[[files."src/version.py"]]
search = '{{old_version}}'
replace = '{{new_version}}'

Configuration

version

A string that is the current version.

files

A table which configures all files need to be modified.

Every key is a relative path name. The value of a key is an array of replacement config. Every item of an array is an object which has two keys: search and replace. The value of search is the pattern to be replaced. The value of replace is the new text after replacing.

The contents of search and replace are Jinja2 templates. Several predefined variables can be used in the templates:

  • old_version

  • new_version

  • now

  • utcnow

now and utcnow are Python datetime objects.

The Jinja2 templates also support a custom filter strftime, which is used to format time such as now and utcnow. The format string is the same as the parameter of strftime method of Python datetime object.

License

MIT

Release files for bumplus 0.12.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bumplus 0.12.0
File Size Uploaded
bumplus-0.12.0.tar.gz 7.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for bumplus 0.12.0
File Interpreter ABI Platform
bumplus-0.12.0-py3-none-any.whl Python 3 none any Details

Total release size: 15.3 kB

Release files / bumplus-0.12.0.tar.gz

Download URL bumplus-0.12.0.tar.gz
Size 7.3 kB
Tags Source
SHA-256 checksum
How to use checksums
51c459b828a500d57c7e7dc1a1894467358b2a07fa2e6429407984453c5c5b74
BLAKE2b-256 checksum
How to use checksums
2057ab75d5597fe3ddad0144d2bda2e8fcf81679df55a58804eae1955eef02ad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.8

Release files / bumplus-0.12.0-py3-none-any.whl

Download URL bumplus-0.12.0-py3-none-any.whl
Size 8.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
24f2f079aa7e1e87df5a2f79189b84e26ab72d37f118ccc5a010447c57d28227
BLAKE2b-256 checksum
How to use checksums
3baab79f244859976a989d77e5f1b8def8db18f52d377b861d8f6a8e84a200e0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.8

Release history Release notifications | RSS feed

This release

0.12.0 This release

2 release files

0.11.0

2 release files

0.10.1

2 release files

0.10.0

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.9

1 release file

0.0.8

1 release file

0.0.7

1 release file

0.0.6

1 release file

0.0.5

1 release file

0.0.4

1 release file

0.0.3

1 release file

0.0.2

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page