Skip to main content

Bump software releases

Project description

https://img.shields.io/travis/SuperTanker/tbump.svg?branch=master https://img.shields.io/pypi/v/tbump.svg https://img.shields.io/github/license/SuperTanker/tbump.svg

Installation

  • Make sure you are using Python 3.4 or later

  • Intall tbump with pip as usual.

Screenshot

Here’s what a typical usage of tbump looks like:

https://raw.githubusercontent.com/SuperTanker/tbump/master/scrot.png

Usage

Create a tbump.toml file looking like:

[version]
current = "1.2.41"
regex = '''
  (?P<major>\d+)
  \.
  (?P<minor>\d+)
  \.
  (?P<patch>\d+)
'''

[git]
message_template = "Bump to {new_version}"
tag_template = "v{new_version}"

[[file]]
src = "setup.py"

Then run:

$ tbump 1.2.42

tbump will:

  • Replace the string 1.2.41 by 1.2.42 in every file listed in the configuration

  • Make a commit based on the message_template. (Using

  • Make an annotated tag based on the tag_template

  • Ask wether to push the current branch and the tag (unless --no-interactive is used)

Advanced configuration

Restricting the lines that are replaced

Sometimes you want to make sure only the line matching a given pattern is replaced. For instance, with the folliwing package.json:

/* in package.json */
{
   "name": "foo",
   "version": "0.42",
   "dependencies": {
     "some-dep": "0.42",
     "other-dep": "1.3",
   }
}

you’ll want to make sure that when you bump from 0.42 to 0.43 that the line containing some-dep does not change.

In this case, you can set a search option in the file section:

# In tbump.toml

[[file]]
src = "package.json"
search = '"version": "{current_version}"'

Using a custom version template

If you are using a version schema like 1.2.3-alpha-4, you may want to expose a variable that only contains the “public” part of the version string. (1.2.3 in this case).

To do so, add a version_template option in te file section. The names used in the format string should match the group names in the regular expression.

/* in version.js */

export FULL_VERSION = '1.2.3-alpha-4';
export PUBLIC_VERSION = '1.2.3';
[[file]]
src = "version.js"
version_template = "{major}.{minor}.{patch}"
search = "export PUBLIC_VERSION = '{current_version}'"

[[file]]
src = "version.js"
search = "export FULL_VERSION = '{current_version}'"

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

tbump-1.0.1.tar.gz (11.9 kB view details)

Uploaded Source

Built Distribution

tbump-1.0.1-py3-none-any.whl (15.9 kB view details)

Uploaded Python 3

File details

Details for the file tbump-1.0.1.tar.gz.

File metadata

  • Download URL: tbump-1.0.1.tar.gz
  • Upload date:
  • Size: 11.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for tbump-1.0.1.tar.gz
Algorithm Hash digest
SHA256 f27a6fb3f963cf59a9437984f5c8261a8a072b8a06bf56e13a4f7e8ebb9fecc4
MD5 1b0dde9b21ef03c06b0651de78bfab7d
BLAKE2b-256 1ef7d14531ded80c4aa2acbb3b9dec11ada4488c27eb22afe5b9ea5a1a196db4

See more details on using hashes here.

File details

Details for the file tbump-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for tbump-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b87f9aee1b9bc06723d422742647d70aeb4eed070566ebf7d10d03b331069b4b
MD5 8fb9832508e3299b81c0537ca0c4c7dd
BLAKE2b-256 9584943b6021e8216c94b1168ec74073508a712df97cedbfc442d2da7bbd9a44

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page