pybump


Namepybump JSON
Version 1.12.2 PyPI version JSON
download
home_pagehttps://github.com/ArieLevs/PyBump
SummaryPython version bumper
upload_time2024-03-16 13:22:41
maintainer
docs_urlNone
authorArie Lev
requires_python
licenseApache License 2.0
keywords bump version appversion versioning helm charts setup.py promote
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            =====================
Python Version Bumper
=====================
.. image:: https://github.com/arielevs/pybump/workflows/Python%20package/badge.svg
    :alt: Build
    :target: https://pypi.org/project/pybump/

.. image:: https://codecov.io/gh/ArieLevs/PyBump/branch/master/graph/badge.svg?token=P3AZKGX5IR
    :alt: Code Coverage
    :target: https://codecov.io/gh/ArieLevs/PyBump

.. image:: https://img.shields.io/pypi/v/pybump.svg
    :alt: Version
    :target: https://pypi.org/project/pybump/

.. image:: https://img.shields.io/pypi/l/pybump.svg?colorB=blue
    :alt: License
    :target: https://pypi.org/project/pybump/

.. image:: https://img.shields.io/pypi/pyversions/pybump.svg
    :alt: Python Version
    :target: https://pypi.org/project/pybump/

| Simple python code to bump kubernetes package manager Helm charts.yaml, VERSION and setup.py files versions. 
| Versions must match semver 2.0.0: https://github.com/semver/semver/blob/master/semver.md
| Version is allowed a lower case 'v' character for example: ``v1.5.4-beta2``

Install
=======
``pip install pybump``

Usage
=====

| **bump** version:
| ``pybump bump [-h] --file PATH_TO_CHART.YAML --level {major,minor,patch} [--quiet]``
|

| **set** explicit version or set auto release+metadata:
| ``pybump set --file PATH_TO_CHART.YAML --set-version X.Y.Z [--quiet]``
|
| the **auto** flag is mainly intended for pull request CIs, by using:
| ``pybump set --file PATH_TO_CHART.YAML --auto [--quiet]``
| pybump will add git commit hash as release info to version

 * NOTE - This can be dangerous as the `auto` flag might detect a git repo you were not intended to bump,
   make sure the bumped file is really a child in the git repo you intended to bump.

| **get** current version:
| ``pybump get --file PATH_TO_CHART.YAML``
|

| update Helm chart **appVersion**:
| in order to bump/get/set the Helm chart appVersion value just add the ``--app-version`` flag
| ``pybump bump [-h] --file PATH_TO_CHART.YAML --level {major,minor,patch} [--quiet] [--app-version]``

 * note that the --app-version flag is relevant only for Helm chart.yaml files and has not effect on other cases.

Examples
========

CLI example
-------------

.. image:: ./docs/pybump-recording.gif


CI Usage example
----------------

Simple jenkins CI (using k8s plugin) that will use the `set --file setup.py --auto` options

..  code-block:: java

    String label = "test-bump-ci-runner"
    podTemplate(
            label: label,
            containers: [
                    containerTemplate(
                            name: 'pybump',
                            image: "arielev/pybump:1.10.2",
                            ttyEnabled: true,
                            command: 'sleep',
                            args: '1d'
                    ),
                    containerTemplate(
                            name: 'jnlp',
                            image: 'jenkins/inbound-agent:jdk11',
                            ttyEnabled: true
                    )
            ]
    ) {
        node(label) {
            timeout(time: 10, unit: 'MINUTES') {
                ansiColor('xterm') {
                    String version = ""
                    container('jnlp') {
                        git credentialsId: "credentials_id_here", url: "https://github.com/arielevs/pybump"
                    }
                    container('pybump') {
                        version = sh(
                                script: "pybump set --file setup.py --auto",
                                returnStdout: true
                        ).trim()
                    }
                    println(version)
                }
            }
        }
    }

| Case: ``version: 0.0.1``
| ``pybump bump --file Chart.yaml --level patch`` will bump version to ``0.0.2``
|

| Case: ``version: 0.1.4-alpha+meta.data``
| ``pybump bump --file Chart.yaml --level minor`` will bump version to ``0.2.0-alpha+meta.data``
|

| Case: ``version: v0.0.3``
| ``pybump bump --file Chart.yaml --level major`` will bump version to ``v1.0.0``
|

| Case: ``version: 0.0.1+some-metadata``
| ``pybump set --file Chart.yaml --set-version 1.4.0`` will set version to ``1.4.0+metadata-here``
|

| Case: ``version: v7.0.2``
| ``pybump set --file setup.py --auto`` will set version to ``v7.0.2-5a51e0e1d9894d3c5d4201619f10be242320cb59``
|

| Case: ``appVersion 2.3.2``
| ``pybump bump --file Chart.yaml --level patch --app-version`` will bump appVersion to ``2.3.3``
|

| Case: ``version: 1.0.13``
| ``pybump get --file Chart.yaml`` will return ``1.0.13``
|

| Case: ``version: 1.0.13+some-metadata``
| ``pybump get --file Chart.yaml --release`` will return ``some``

using a container image
-----------------------
| ``docker run --rm --volume $(pwd):/tmp -t arielev/pybump set --file /tmp/setup.py --auto``
|

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/ArieLevs/PyBump",
    "name": "pybump",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "bump,version,appVersion,versioning,helm,charts,setup.py,promote",
    "author": "Arie Lev",
    "author_email": "levinsonarie@gmail.com",
    "download_url": "",
    "platform": null,
    "description": "=====================\nPython Version Bumper\n=====================\n.. image:: https://github.com/arielevs/pybump/workflows/Python%20package/badge.svg\n    :alt: Build\n    :target: https://pypi.org/project/pybump/\n\n.. image:: https://codecov.io/gh/ArieLevs/PyBump/branch/master/graph/badge.svg?token=P3AZKGX5IR\n    :alt: Code Coverage\n    :target: https://codecov.io/gh/ArieLevs/PyBump\n\n.. image:: https://img.shields.io/pypi/v/pybump.svg\n    :alt: Version\n    :target: https://pypi.org/project/pybump/\n\n.. image:: https://img.shields.io/pypi/l/pybump.svg?colorB=blue\n    :alt: License\n    :target: https://pypi.org/project/pybump/\n\n.. image:: https://img.shields.io/pypi/pyversions/pybump.svg\n    :alt: Python Version\n    :target: https://pypi.org/project/pybump/\n\n| Simple python code to bump kubernetes package manager Helm charts.yaml, VERSION and setup.py files versions. \n| Versions must match semver 2.0.0: https://github.com/semver/semver/blob/master/semver.md\n| Version is allowed a lower case 'v' character for example: ``v1.5.4-beta2``\n\nInstall\n=======\n``pip install pybump``\n\nUsage\n=====\n\n| **bump** version:\n| ``pybump bump [-h] --file PATH_TO_CHART.YAML --level {major,minor,patch} [--quiet]``\n|\n\n| **set** explicit version or set auto release+metadata:\n| ``pybump set --file PATH_TO_CHART.YAML --set-version X.Y.Z [--quiet]``\n|\n| the **auto** flag is mainly intended for pull request CIs, by using:\n| ``pybump set --file PATH_TO_CHART.YAML --auto [--quiet]``\n| pybump will add git commit hash as release info to version\n\n * NOTE - This can be dangerous as the `auto` flag might detect a git repo you were not intended to bump,\n   make sure the bumped file is really a child in the git repo you intended to bump.\n\n| **get** current version:\n| ``pybump get --file PATH_TO_CHART.YAML``\n|\n\n| update Helm chart **appVersion**:\n| in order to bump/get/set the Helm chart appVersion value just add the ``--app-version`` flag\n| ``pybump bump [-h] --file PATH_TO_CHART.YAML --level {major,minor,patch} [--quiet] [--app-version]``\n\n * note that the --app-version flag is relevant only for Helm chart.yaml files and has not effect on other cases.\n\nExamples\n========\n\nCLI example\n-------------\n\n.. image:: ./docs/pybump-recording.gif\n\n\nCI Usage example\n----------------\n\nSimple jenkins CI (using k8s plugin) that will use the `set --file setup.py --auto` options\n\n..  code-block:: java\n\n    String label = \"test-bump-ci-runner\"\n    podTemplate(\n            label: label,\n            containers: [\n                    containerTemplate(\n                            name: 'pybump',\n                            image: \"arielev/pybump:1.10.2\",\n                            ttyEnabled: true,\n                            command: 'sleep',\n                            args: '1d'\n                    ),\n                    containerTemplate(\n                            name: 'jnlp',\n                            image: 'jenkins/inbound-agent:jdk11',\n                            ttyEnabled: true\n                    )\n            ]\n    ) {\n        node(label) {\n            timeout(time: 10, unit: 'MINUTES') {\n                ansiColor('xterm') {\n                    String version = \"\"\n                    container('jnlp') {\n                        git credentialsId: \"credentials_id_here\", url: \"https://github.com/arielevs/pybump\"\n                    }\n                    container('pybump') {\n                        version = sh(\n                                script: \"pybump set --file setup.py --auto\",\n                                returnStdout: true\n                        ).trim()\n                    }\n                    println(version)\n                }\n            }\n        }\n    }\n\n| Case: ``version: 0.0.1``\n| ``pybump bump --file Chart.yaml --level patch`` will bump version to ``0.0.2``\n|\n\n| Case: ``version: 0.1.4-alpha+meta.data``\n| ``pybump bump --file Chart.yaml --level minor`` will bump version to ``0.2.0-alpha+meta.data``\n|\n\n| Case: ``version: v0.0.3``\n| ``pybump bump --file Chart.yaml --level major`` will bump version to ``v1.0.0``\n|\n\n| Case: ``version: 0.0.1+some-metadata``\n| ``pybump set --file Chart.yaml --set-version 1.4.0`` will set version to ``1.4.0+metadata-here``\n|\n\n| Case: ``version: v7.0.2``\n| ``pybump set --file setup.py --auto`` will set version to ``v7.0.2-5a51e0e1d9894d3c5d4201619f10be242320cb59``\n|\n\n| Case: ``appVersion 2.3.2``\n| ``pybump bump --file Chart.yaml --level patch --app-version`` will bump appVersion to ``2.3.3``\n|\n\n| Case: ``version: 1.0.13``\n| ``pybump get --file Chart.yaml`` will return ``1.0.13``\n|\n\n| Case: ``version: 1.0.13+some-metadata``\n| ``pybump get --file Chart.yaml --release`` will return ``some``\n\nusing a container image\n-----------------------\n| ``docker run --rm --volume $(pwd):/tmp -t arielev/pybump set --file /tmp/setup.py --auto``\n|\n",
    "bugtrack_url": null,
    "license": "Apache License 2.0",
    "summary": "Python version bumper",
    "version": "1.12.2",
    "project_urls": {
        "Homepage": "https://github.com/ArieLevs/PyBump"
    },
    "split_keywords": [
        "bump",
        "version",
        "appversion",
        "versioning",
        "helm",
        "charts",
        "setup.py",
        "promote"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e10104e8664be6492335fa37bfe7a2bf6008020b1dbe8a3aea859b30560ff7a1",
                "md5": "ff39a8035aa508575dc066f26524992e",
                "sha256": "437ce5dd23d07b12fff78a3c84b4df64f9143f37479e1d48c0ba447578d815bc"
            },
            "downloads": -1,
            "filename": "pybump-1.12.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ff39a8035aa508575dc066f26524992e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 23383,
            "upload_time": "2024-03-16T13:22:41",
            "upload_time_iso_8601": "2024-03-16T13:22:41.658496Z",
            "url": "https://files.pythonhosted.org/packages/e1/01/04e8664be6492335fa37bfe7a2bf6008020b1dbe8a3aea859b30560ff7a1/pybump-1.12.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-16 13:22:41",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ArieLevs",
    "github_project": "PyBump",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "pybump"
}
        
Elapsed time: 0.23948s