Updates the release numbers for a projects
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.5.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| bump_release-0.5.9.tar.gz | 6.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| bump_release-0.5.9-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 16.5 kB
Release files / bump_release-0.5.9.tar.gz
| Download URL | bump_release-0.5.9.tar.gz |
|---|---|
| Size | 6.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fcc1f9348fa785f4ec2193e3f6157d4bdcf34d94f710ee4ffb307778b46af153
|
|
BLAKE2b-256 checksum How to use checksums |
a2fd4cc873bdaf762800b276c0099972e95ce22f948dff4ded94d56e4e0a3fa3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4
|
Release files / bump_release-0.5.9-py3-none-any.whl
| Download URL | bump_release-0.5.9-py3-none-any.whl |
|---|---|
| Size | 9.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
311058ff7d238aa6b140c501bf9ed5a0da64ca1ed3bdd8b82ae0dd2b0d60a8b5
|
|
BLAKE2b-256 checksum How to use checksums |
a78636392d9e8a8672e18e6ab97a1f6f2ed0914b998004695c07f10662c7688a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4
|