Want to add version bump checks to your CI/CD pipeline? This packages makes it easy.
Simply execute check-bump
within a directory where your pyproject.toml
is located.
If there was a version bump, process will finish with exit code 0 - read stdout for the new version. Otherwise, process will finish with exit code 1.
This package requires tomlkit
package.
Simply execute check-bump
within a directory where your pyproject.toml
is located. Or provide a path using --path
argument.
user$ check-bump --help
usage: check-bump [-h] {toml,regex,touch} ...
Detect and retrieve version bump
options:
-h, --help show this help message and exit
Methods:
{toml,regex,touch} Different methods for parsing files
toml Parsing toml file
regex Regex file parsing
touch Touch file check
Required Select which method to use for detecting version bumps.
Optional Relative path of versioning file. Example: 'python_src/pyproject.toml'
Optional Prefix to provide for version output. Example: 'v'
always Whether there was a bump or not. Values: 'true'
|'false'
optional Current (if bumped) version with prefix. If there was no version bump - no output is provided.
- name: Check bump
id: vbump
uses: rgryta/Check-Bump@main
with:
method: 'toml'
prefix: 'v'
And then you can later reference like:
- name: Tag repository
if: steps.vbump.outputs.bump == 'true'
run: |
echo "I was bumped to version: ${{ steps.vbump.outputs.version }}"
Install virtual environment and check_bump package in editable mode with dev dependencies.
python -m venv venv
source venv/bin/activate
pip install -e .[dev]
Automate as much as we can, see configuration in pyproject.toml
file to see what are the flags used.
staging format # Reformat the code
staging lint # Check for linting issues
staging test # Run unit tests and coverage report