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
pattern = r"^__version__\s*=\s*VERSION\s*=\s*['\"][.\d\w]+['\"]$" # Optional
template = '__version__ = VERSION = "{major}.{minor}.{release}"\n' # Optional
[node_module]
path = <project>/assets/package.json
key = "version" # Optional
[sonar]
path = ./sonar-project.properties
pattern = r"^sonar.projectVersion=([.\d]+)$" # Optional
template = "sonar.projectVersion={major}.{minor}\n" # Optional
[docs]
path = <project>/../docs/source/conf.py
version_pattern = r"^version\s+=\s+[\"']([.\d]+)[\"']$" # Optional
version_format = 'version = "{major}.{minor}"\n' # Optional
release_pattern = r"^release\s+=\s+[\"']([.\d]+)[\"']$" # Optional
release_format = 'release = "{major}.{minor}.{release}"\n' # Optional
[ansible]
path = <project>/../ansible/prod/vars/vars.yml"
key = "git.version" # Optional
[setup]
path = <project>/setup.py
pattern = "^\s*version=['\"]([.\d]+)['\"],$"
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.4.2
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.4.2.tar.gz | 2.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| bump_release-0.4.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 5.2 kB
Release files / bump_release-0.4.2.tar.gz
| Download URL | bump_release-0.4.2.tar.gz |
|---|---|
| Size | 2.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a1fab7510851e75d1eb1313dbc00effeec09f735485d1144648f25119ded5cde
|
|
BLAKE2b-256 checksum How to use checksums |
42b076876eced53677a12940d5dac2510bda8c6fda330a86f90fd1ecc71463ee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.14.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.4
|
Release files / bump_release-0.4.2-py3-none-any.whl
| Download URL | bump_release-0.4.2-py3-none-any.whl |
|---|---|
| Size | 3.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
42531331cbae7c707cee5793e1dd66a2c01517508c162bac7c13af5ec9b754e7
|
|
BLAKE2b-256 checksum How to use checksums |
4dc3e90db67c796b21b3d694d15eee23ccedafec97d3cd5e5e10a39f7103f0ea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.14.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.4
|