A small command line tool to bump tracked versions in your repository.
Project description
bumpit
A small command line tool to bump tracked versions in your repository.
It is designed to integrate well with your CI/CD pipeline. Simply install and run bumpit as part of your pipeline. Let the robots do the boring work!
Installation
You can download and install bumpit from PyPI by running:
pip install bumpit
Usage
At a high level, you need to
- setup the configuration file
.bumpconfig.yamlin your target folder. - run
bumpit. - and when you are ready, push the changes to your
remotegit push origin master --tags
Usage
Usage: bumpit [OPTIONS]
Options:
-d, --dry-run Run the tool in dry run mode
-c, --config TEXT Configuration settings
--help Show this message and exit.
Configuration
bumpit relies heavily on a configuration file capture all runtime context of bumpit. This config file is named .bumpconfig.yaml by default. You can override this using the --config option in the command line.
The config file looks like:
current_version: "0.0.1"
strategy: "semver-patch"
tag: True
tag_format: "{version}"
tracked_files:
- setup.py
where:
current_version- the current version of your files. It needs to be wrapped in quotes to force parsing to be string (e.g. avoid calver current_version to be parsed as float)- strategy - supported values
semver-major,semver-minor,semver-patch,calver tag- bool value to instruct the tool to tag the repository after the version updatetag_format- format of the tag. Some people prefer to add prefix to their tag versions (e.g.release/1.0.1). As long as the{version}is present, then it is a validtag_format- tracked_files - a list of relative filenames to update version to. If the current_version is not found, the tool simply skips this file
Examples
Check out the following repositories for examples:
Version Strategies
The tool currently supports the following versioning strategies
Semantic Version
buildit implements a very basic semver scheme. It validates the right format using the proposed format.
Notice that semantic version has optional meta tokens after the usual major.minor.patch tokens. When meta token is present and bumpit runs, bumpit naively updates the major.minor.patch version based on the strategy and leave the meta token as is. If this is not your expected behaviour, please help me understand how it should be handled. You can create an issue and perhaps a PR of your proposed solution.
Calendar Version
buildit implements a very basic calver scheme. It assumes that the version follows the format YYYYmm.variant where
YYYY- yearmm- month zero paddedvariant- incrementing integer to distinguish different version for the same month
When the month rolls over to the next, YYYYmm will be the new month, and variant resets to 1.
The format is quite concrete. This was sufficient enough for my use case. However, if you feel that this is too simplistic, please feel free to create an issue and perhaps a PR of your proposed solution.
Development
Contribution
Code and documentation improvements are all welcome. You can also file bug reports or feature suggestions.
The feature set is meant to handle different versioning strategies. Currently, the strategies I know are applied in the wilds are implemented, but it is by no means complete!
Publishing
To publish bumpit, run the following
git checkout master
git pull
bumpit
git push origin master --tags
python setup.py bdist_wheel sdist
twine upload dist/*
License
bumpit is released under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bumpit-0.0.3.tar.gz.
File metadata
- Download URL: bumpit-0.0.3.tar.gz
- Upload date:
- Size: 8.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a9b783eb586519a8a542474422e4e2b799304c922a9ef6eca2f6985aa944806f
|
|
| MD5 |
d3a02efd3622dbc01ca8db6ced488d77
|
|
| BLAKE2b-256 |
6322901a1a4de44f33179ef1ecd561cae2ab0f51799734beb25439e4e0142305
|
File details
Details for the file bumpit-0.0.3-py3-none-any.whl.
File metadata
- Download URL: bumpit-0.0.3-py3-none-any.whl
- Upload date:
- Size: 12.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3e4121213f23847f58bbab7588ee23617547705cb95a990696758da081d5aa50
|
|
| MD5 |
66124a096f089cb7afb12915154fd37b
|
|
| BLAKE2b-256 |
4c83e020553b9345a8bd213d434be040a11c948167f11625b02c15023deff937
|