Skip to main content

Updates the release numbers for a projects

pipeline status

coverage report

This script uses the release.ini file placed at the root of the project.

release.ini

[DEFAULT]
current_release = 0.1.0  # Current version of the projects

[main_project]
path = <project>/settings/base.py
# Optional pattern, default is...
pattern = r"^__version__\s*=\s*VERSION\s*=\s*['\"][.\d\w]+['\"]$"
# Optional template, default is...
template = '__version__ = VERSION = "{major}.{minor}.{release}"\n'

[node_module]
path = <project>/assets/package.json
# Optional key, default is...
key = "version"

[sonar]
path = ./sonar-project.properties
# Optional pattern, default is...
pattern = r"^sonar.projectVersion=([.\d]+)$"
# Optional template, default is...
template = "sonar.projectVersion={major}.{minor}\n"

[docs]
path = <project>/../docs/source/conf.py
# Optional pattern, default is...
version_pattern = r"^version\s+=\s+[\"']([.\d]+)[\"']$"
# Optional template, default is...
version_format = 'version = "{major}.{minor}"\n'
# Optional pattern, default is...
release_pattern = r"^release\s+=\s+[\"']([.\d]+)[\"']$"
# Optional template, default is...
release_format = 'release = "{major}.{minor}.{release}"\n'

[ansible]
path = <project>/../ansible/prod/vars/vars.yml"
# Optional key - The script searches for the "git" root key, and then for "version" sub-key
key = "git.version"

[setup]
path = <project>/setup.py
# Optional pattern, default is...
pattern = "^\s*version=['\"]([.\d]+)['\"],$"
# Optional template, default is...
template = "    version=\"{major}.{minor}.{release}\","

Version numbers that can be updated

  • main project version
  • node package.json
  • sonar properties
  • sphinx docs
  • ansible variables in a vars file
  • setup.py

Installation

$ pip install --user bump-release

Usage

$ cd <project_root>
$ cat release.ini
[DEFAULT}
current_release = 0.0.1

[main_project]
path = "foo/__init__.py"

[sonar]
path = "sonar-project.properties"
...
$ cat foo/__init__.py
...
__version__ = VERSION = "0.0.1"
...
$ bump_release 0.0.2
...
$ cat release.ini
[DEFAULT}
current_release = 0.0.2
...
$ cat foo/__init__.py
...
__version__ = VERSION = "0.0.2"
...

Metadata

Release files for bump-release 0.8.2

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

Source distribution (sdist)

Source distribution for bump-release 0.8.2
File Size Uploaded
bump_release-0.8.2.tar.gz 7.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for bump-release 0.8.2
File Interpreter ABI Platform
bump_release-0.8.2-py3-none-any.whl Python 3 none any Details

Total release size: 17.1 kB

Release files / bump_release-0.8.2.tar.gz

Download URL bump_release-0.8.2.tar.gz
Size 7.1 kB
Tags Source
SHA-256 checksum
How to use checksums
f3d9c01f1a05faecde6ea491eb75cbd7dc274eb4878b846018ceb02e3b4b3fc8
BLAKE2b-256 checksum
How to use checksums
893b759e345740e952b800db20a900690157f5a9f6d43e1e81a590b56024f918
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.8

Release files / bump_release-0.8.2-py3-none-any.whl

Download URL bump_release-0.8.2-py3-none-any.whl
Size 10.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c05f44191d390650dedeb66d333b78b9a977c080a9a29dc21927011b1653e963
BLAKE2b-256 checksum
How to use checksums
0ab8f11d0ae5e0e97ecfdd4afdf5fe9e427aba5be489ca28f82776ea3985ad8c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.8

Release history Release notifications | RSS feed

0.10.6

2 release files

0.10.3

2 release files

0.10.2

2 release files

0.9.9

2 release files

0.9.7

1 release file

0.9.6

2 release files

0.9.5

2 release files

0.9.3

2 release files

0.9.1

2 release files

This release

0.8.2 This release

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.9

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.2

2 release files

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