check-bump


Namecheck-bump JSON
Version 1.1.0 PyPI version JSON
download
home_pageNone
SummaryCheck if pyproject.toml version was bumped
upload_time2024-07-17 14:45:57
maintainerNone
docs_urlNone
authorNone
requires_python>=3.11
licenseNone
keywords versioning check ci cd version bump
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <p align="center"></p>
<h2 align="center">Check Bump</h2>
<p align="center">
<a href="https://github.com/rgryta/Check-Bump/actions/workflows/main.yml"><img alt="Build" src="https://github.com/rgryta/Check-Bump/actions/workflows/main.yml/badge.svg?branch=main"></a>
<a href="https://pypi.org/project/check-bump/"><img alt="PyPI" src="https://img.shields.io/pypi/v/check-bump"></a>
<a href="https://github.com/psf/black"><img alt="Code style: black" src="https://img.shields.io/badge/code%20style-black-000000.svg"></a>
<a href="https://github.com/PyCQA/pylint"><img alt="pylint" src="https://img.shields.io/badge/linting-pylint-yellowgreen"></a>
<a href="https://github.com/rgryta/NoPrint"><img alt="NoPrint" src="https://img.shields.io/badge/NoPrint-enabled-blueviolet"></a>
</p>

## 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.

```bash
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

```yml
- name: Check bump
  id: vbump
  uses: rgryta/Check-Bump@main
  with:
    method: 'toml'
    prefix: 'v'
```

And then you can later reference like:
```yml
- 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.

```bash
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.

```bash
staging format  # Reformat the code
staging lint    # Check for linting issues
staging test    # Run unit tests and coverage report
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "check-bump",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.11",
    "maintainer_email": null,
    "keywords": "versioning, check, CI, CD, version, bump",
    "author": null,
    "author_email": "Radoslaw Gryta <radek.gryta@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/ad/7d/2eb84d5bb632cfa0989fa2c675d547f844a292f51f9fe92b84bea353a836/check_bump-1.1.0.tar.gz",
    "platform": null,
    "description": "<p align=\"center\"></p>\n<h2 align=\"center\">Check Bump</h2>\n<p align=\"center\">\n<a href=\"https://github.com/rgryta/Check-Bump/actions/workflows/main.yml\"><img alt=\"Build\" src=\"https://github.com/rgryta/Check-Bump/actions/workflows/main.yml/badge.svg?branch=main\"></a>\n<a href=\"https://pypi.org/project/check-bump/\"><img alt=\"PyPI\" src=\"https://img.shields.io/pypi/v/check-bump\"></a>\n<a href=\"https://github.com/psf/black\"><img alt=\"Code style: black\" src=\"https://img.shields.io/badge/code%20style-black-000000.svg\"></a>\n<a href=\"https://github.com/PyCQA/pylint\"><img alt=\"pylint\" src=\"https://img.shields.io/badge/linting-pylint-yellowgreen\"></a>\n<a href=\"https://github.com/rgryta/NoPrint\"><img alt=\"NoPrint\" src=\"https://img.shields.io/badge/NoPrint-enabled-blueviolet\"></a>\n</p>\n\n## About\n\nWant to add version bump checks to your CI/CD pipeline? This packages makes it easy.\nSimply execute `check-bump` within a directory where your `pyproject.toml` is located.\n\nIf there was a version bump, process will finish with exit code 0 - read stdout for the new version.\nOtherwise, process will finish with exit code 1.\n\n## Requirements\n\nThis package requires `tomlkit` package.\n\n## Usage\n\n### Command\n\nSimply execute `check-bump` within a directory where your `pyproject.toml` is located. Or provide a path using `--path` argument.\n\n```bash\nuser$ check-bump --help\nusage: check-bump [-h] {toml,regex,touch} ...\n\nDetect and retrieve version bump\n\noptions:\n  -h, --help          show this help message and exit\n\nMethods:\n  {toml,regex,touch}  Different methods for parsing files\n    toml              Parsing toml file\n    regex             Regex file parsing\n    touch             Touch file check\n```\n\n### Github Actions\n\n#### Inputs\n\n##### `method`\n\n**Required** Select which method to use for detecting version bumps.\n\n##### `path`\n\n**Optional** Relative path of versioning file. Example: `'python_src/pyproject.toml'`\n\n##### `prefix`\n\n**Optional** Prefix to provide for version output. Example: `'v'`\n\n#### Outputs\n\n##### `bump`\n\n**always** Whether there was a bump or not. Values: `'true'`|`'false'`\n\n##### `version`\n\n**optional** Current (if bumped) version with prefix. If there was no version bump - no output is provided.\n\n## Example usage\n\n```yml\n- name: Check bump\n  id: vbump\n  uses: rgryta/Check-Bump@main\n  with:\n    method: 'toml'\n    prefix: 'v'\n```\n\nAnd then you can later reference like:\n```yml\n- name: Tag repository\n  if: steps.vbump.outputs.bump == 'true'\n  run: |\n    echo \"I was bumped to version: ${{ steps.vbump.outputs.version }}\"\n```\n\n## Development\n\n### Installation\n\nInstall virtual environment and check_bump package in editable mode with dev dependencies.\n\n```bash\npython -m venv venv\nsource venv/bin/activate\npip install -e .[dev]\n```\n\n\n### How to?\n\nAutomate as much as we can, see configuration in `pyproject.toml` file to see what are the flags used.\n\n```bash\nstaging format  # Reformat the code\nstaging lint    # Check for linting issues\nstaging test    # Run unit tests and coverage report\n```\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Check if pyproject.toml version was bumped",
    "version": "1.1.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/rgryta/Check-Bump/issues",
        "Homepage": "https://github.com/rgryta/Check-Bump"
    },
    "split_keywords": [
        "versioning",
        " check",
        " ci",
        " cd",
        " version",
        " bump"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ed092d46283b4835887c312c9d7d5f66c4552826424d42e7ed9ed4b31e5381de",
                "md5": "f5199b66db6c7bfc6d90ef1a6041e1a5",
                "sha256": "5754f012ea26119c970c7f66a0e4a82f30cac564b4eeffb4590b18b29faca359"
            },
            "downloads": -1,
            "filename": "check_bump-1.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f5199b66db6c7bfc6d90ef1a6041e1a5",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 8802,
            "upload_time": "2024-07-17T14:45:55",
            "upload_time_iso_8601": "2024-07-17T14:45:55.921908Z",
            "url": "https://files.pythonhosted.org/packages/ed/09/2d46283b4835887c312c9d7d5f66c4552826424d42e7ed9ed4b31e5381de/check_bump-1.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ad7d2eb84d5bb632cfa0989fa2c675d547f844a292f51f9fe92b84bea353a836",
                "md5": "8c3335ac02e42753496c85cb55b9ca61",
                "sha256": "22878a0cbc7856c7b020d1efbd76319e4aea9d54b0d31823caaf946fb31d95ca"
            },
            "downloads": -1,
            "filename": "check_bump-1.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "8c3335ac02e42753496c85cb55b9ca61",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11",
            "size": 7334,
            "upload_time": "2024-07-17T14:45:57",
            "upload_time_iso_8601": "2024-07-17T14:45:57.032743Z",
            "url": "https://files.pythonhosted.org/packages/ad/7d/2eb84d5bb632cfa0989fa2c675d547f844a292f51f9fe92b84bea353a836/check_bump-1.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-17 14:45:57",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "rgryta",
    "github_project": "Check-Bump",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "check-bump"
}
        
Elapsed time: 4.91666s