Skip to main content

Check if pyproject.toml version was bumped

Project description

Check Bump

Build PyPI Code style: black pylint NoPrint

About

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.

Requirements

This package requires tomlkit package.

Usage

Command

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

Github Actions

Inputs

method

Required Select which method to use for detecting version bumps.

path

Optional Relative path of versioning file. Example: 'python_src/pyproject.toml'

prefix

Optional Prefix to provide for version output. Example: 'v'

Outputs

bump

always Whether there was a bump or not. Values: 'true'|'false'

version

optional Current (if bumped) version with prefix. If there was no version bump - no output is provided.

Example usage

- 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 }}"

Development

Installation

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]

How to?

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

check_bump-1.1.1.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

check_bump-1.1.1-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file check_bump-1.1.1.tar.gz.

File metadata

  • Download URL: check_bump-1.1.1.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for check_bump-1.1.1.tar.gz
Algorithm Hash digest
SHA256 5f7b84e8dcd6029448b9fc6a9bd77d835c61a50636064010466fb269e2627e4c
MD5 cf3bb416e0d90de2363f13655c840b66
BLAKE2b-256 ee4f0cb580c7085cc2f9df4eca5bb468465fa8d8150bbbd2d14502a470a445f4

See more details on using hashes here.

File details

Details for the file check_bump-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: check_bump-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 10.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for check_bump-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2f513a3c6e8247cdb18a33d750a000cb468d3400c4a784a4c5ad4f7123dc258c
MD5 0e93a7ee6874726e477ac5739e94d563
BLAKE2b-256 d49a0aa3d56cf38657b46986f6772dcd31e67a98490f1b82aa2432be725df1fa

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page