####################
poetry-bumpversion
####################
| |logo|
The ``poetry version`` command only updates version in ``pyproject.toml`` file.
This plugin updates version in other files when ``poetry version <version>``
command is executed.
| |build-status| |coverage.io| |pyversions| |pypi-version| |license|
********************
Getting Started
********************
++++++++++++++++++++
Prerequisites
++++++++++++++++++++
- python = ^3.8
- poetry = ^1.2.0
++++++++++++++++++++
Install
++++++++++++++++++++
Install the plugin by poetry plugin command.
::
poetry self add poetry-bumpversion
++++++++++++++++++++++++++++++
Configure version replacements
++++++++++++++++++++++++++++++
Say you have ``__version__`` variable set at ``your_package/__init__.py`` file
.. code:: python
__version__ = "0.1.0" # It MUST match the version in pyproject.toml file
Add the following to your ``pyproject.toml`` file.
.. code:: toml
[tool.poetry_bumpversion.file."your_package/__init__.py"]
# Duplicate the line above to add more files
Now run ``poetry version patch --dry-run``, if your output looks somewhat like below
you are all set (dry-run does not update any file).
::
Bumping version from 0.5.0 to 0.5.1
poetry-bumpversion: processed file: your_package/__init__.py
If dry-run output looks fine you can run version update command without dry-run flag to
check if version in both ``pyproject.toml`` and ``your_package/__init__.py`` file has been updated.
********************
Advanced Usage
********************
You can define search and replace terms to be more precise
.. code:: toml
[tool.poetry_bumpversion.file."your_package/__init__.py"]
search = '__version__ = "{current_version}"'
replace = '__version__ = "{new_version}"'
You can define replacements if you have same search/replace patterns
across multiple files.
.. code:: toml
[[tool.poetry_bumpversion.replacements]]
files = ["your_package/__init__.py", "your_package/version.py"]
search = '__version__ = "{current_version}"'
replace = '__version__ = "{new_version}"'
[[tool.poetry_bumpversion.replacements]]
files = ["README.md"]
search = 'version: {current_version}'
replace = 'version: {new_version}'
******************************
Usage with Github Workflow
******************************
This plugin can be used to bump version automatically during publishing to PyPI using a GitHub workflow.
When a release tag is created the workflow will use that tag name e.g ``2.0.1`` to update versions in every
files, build the package and publish to PyPI. This is how this plugin is deployed to PyPI.
To get started you can copy the `deploy workflow code`_ from this repo to your repo and set it up.
.. _deploy workflow code: https://github.com/monim67/poetry-bumpversion/blob/master/.github/workflows/deploy.yml
********************
License
********************
This project is licensed under MIT License - see the
`LICENSE <https://github.com/monim67/poetry-bumpversion/blob/master/LICENSE>`_ file for details.
.. |logo| image:: https://github.com/monim67/poetry-bumpversion/blob/main/.github/assets/logo.png?raw=true
:alt: Logo
.. |build-status| image:: https://github.com/monim67/poetry-bumpversion/actions/workflows/build.yml/badge.svg?event=push
:target: https://github.com/monim67/poetry-bumpversion/actions/workflows/build.yml
:alt: Build Status
:height: 20px
.. |coverage.io| image:: https://coveralls.io/repos/github/monim67/poetry-bumpversion/badge.svg
:target: https://coveralls.io/github/monim67/poetry-bumpversion
:alt: Coverage Status
:height: 20px
.. |pyversions| image:: https://img.shields.io/pypi/pyversions/poetry-bumpversion.svg
:target: https://pypi.python.org/pypi/poetry-bumpversion
:alt: Python Versions
:height: 20px
.. |pypi-version| image:: https://badge.fury.io/py/poetry-bumpversion.svg
:target: https://pypi.python.org/pypi/poetry-bumpversion
:alt: PyPI version
:height: 20px
.. |license| image:: https://img.shields.io/pypi/l/poetry-bumpversion.svg
:target: https://pypi.python.org/pypi/poetry-bumpversion
:alt: Licence
:height: 20px
Raw data
{
"_id": null,
"home_page": "https://github.com/monim67/poetry-bumpversion",
"name": "poetry-bumpversion",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8,<4.0",
"maintainer_email": "",
"keywords": "poetry,bump,version,plugin",
"author": "Munim Munna",
"author_email": "6266677+monim67@users.noreply.github.com",
"download_url": "https://files.pythonhosted.org/packages/0f/5c/cec670e30fe224109e4abfa9977311b0881b963f13ebd55a88aec5c71338/poetry_bumpversion-0.3.2.tar.gz",
"platform": null,
"description": "####################\npoetry-bumpversion\n####################\n\n| |logo|\n\nThe ``poetry version`` command only updates version in ``pyproject.toml`` file.\nThis plugin updates version in other files when ``poetry version <version>``\ncommand is executed.\n\n| |build-status| |coverage.io| |pyversions| |pypi-version| |license|\n\n********************\nGetting Started\n********************\n\n++++++++++++++++++++\nPrerequisites\n++++++++++++++++++++\n\n- python = ^3.8\n- poetry = ^1.2.0\n\n++++++++++++++++++++\nInstall\n++++++++++++++++++++\n\nInstall the plugin by poetry plugin command.\n\n::\n\n poetry self add poetry-bumpversion\n\n++++++++++++++++++++++++++++++\nConfigure version replacements\n++++++++++++++++++++++++++++++\n\nSay you have ``__version__`` variable set at ``your_package/__init__.py`` file\n\n.. code:: python\n\n __version__ = \"0.1.0\" # It MUST match the version in pyproject.toml file\n\n\nAdd the following to your ``pyproject.toml`` file.\n\n.. code:: toml\n\n [tool.poetry_bumpversion.file.\"your_package/__init__.py\"]\n # Duplicate the line above to add more files\n\nNow run ``poetry version patch --dry-run``, if your output looks somewhat like below\nyou are all set (dry-run does not update any file).\n\n::\n\n Bumping version from 0.5.0 to 0.5.1\n poetry-bumpversion: processed file: your_package/__init__.py\n\nIf dry-run output looks fine you can run version update command without dry-run flag to\ncheck if version in both ``pyproject.toml`` and ``your_package/__init__.py`` file has been updated.\n\n********************\nAdvanced Usage\n********************\n\nYou can define search and replace terms to be more precise\n\n.. code:: toml\n\n [tool.poetry_bumpversion.file.\"your_package/__init__.py\"]\n search = '__version__ = \"{current_version}\"'\n replace = '__version__ = \"{new_version}\"'\n\nYou can define replacements if you have same search/replace patterns\nacross multiple files.\n\n.. code:: toml\n\n [[tool.poetry_bumpversion.replacements]]\n files = [\"your_package/__init__.py\", \"your_package/version.py\"]\n search = '__version__ = \"{current_version}\"'\n replace = '__version__ = \"{new_version}\"'\n\n [[tool.poetry_bumpversion.replacements]]\n files = [\"README.md\"]\n search = 'version: {current_version}'\n replace = 'version: {new_version}'\n\n******************************\nUsage with Github Workflow\n******************************\n\nThis plugin can be used to bump version automatically during publishing to PyPI using a GitHub workflow.\nWhen a release tag is created the workflow will use that tag name e.g ``2.0.1`` to update versions in every\nfiles, build the package and publish to PyPI. This is how this plugin is deployed to PyPI.\n\nTo get started you can copy the `deploy workflow code`_ from this repo to your repo and set it up.\n\n.. _deploy workflow code: https://github.com/monim67/poetry-bumpversion/blob/master/.github/workflows/deploy.yml\n\n********************\nLicense\n********************\n\nThis project is licensed under MIT License - see the\n`LICENSE <https://github.com/monim67/poetry-bumpversion/blob/master/LICENSE>`_ file for details.\n\n\n.. |logo| image:: https://github.com/monim67/poetry-bumpversion/blob/main/.github/assets/logo.png?raw=true\n :alt: Logo\n\n.. |build-status| image:: https://github.com/monim67/poetry-bumpversion/actions/workflows/build.yml/badge.svg?event=push\n :target: https://github.com/monim67/poetry-bumpversion/actions/workflows/build.yml\n :alt: Build Status\n :height: 20px\n\n.. |coverage.io| image:: https://coveralls.io/repos/github/monim67/poetry-bumpversion/badge.svg\n :target: https://coveralls.io/github/monim67/poetry-bumpversion\n :alt: Coverage Status\n :height: 20px\n\n.. |pyversions| image:: https://img.shields.io/pypi/pyversions/poetry-bumpversion.svg\n :target: https://pypi.python.org/pypi/poetry-bumpversion\n :alt: Python Versions\n :height: 20px\n\n.. |pypi-version| image:: https://badge.fury.io/py/poetry-bumpversion.svg\n :target: https://pypi.python.org/pypi/poetry-bumpversion\n :alt: PyPI version\n :height: 20px\n\n.. |license| image:: https://img.shields.io/pypi/l/poetry-bumpversion.svg\n :target: https://pypi.python.org/pypi/poetry-bumpversion\n :alt: Licence\n :height: 20px\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Poetry plugin to update __version__ in __init__ file and other files containing version strings",
"version": "0.3.2",
"project_urls": {
"Homepage": "https://github.com/monim67/poetry-bumpversion",
"Repository": "https://github.com/monim67/poetry-bumpversion"
},
"split_keywords": [
"poetry",
"bump",
"version",
"plugin"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "dd980f269412debe2c92b6362c6193bc4fb29b7cb39fef0ea42d47e8ff3ae8b4",
"md5": "d916278119adb2ac09b86519e5fc3118",
"sha256": "df51b3c27330820ad036e83b6ab6db083dcaeb13bab3f320b781c69a38773f81"
},
"downloads": -1,
"filename": "poetry_bumpversion-0.3.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "d916278119adb2ac09b86519e5fc3118",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8,<4.0",
"size": 6474,
"upload_time": "2023-12-12T09:15:29",
"upload_time_iso_8601": "2023-12-12T09:15:29.250136Z",
"url": "https://files.pythonhosted.org/packages/dd/98/0f269412debe2c92b6362c6193bc4fb29b7cb39fef0ea42d47e8ff3ae8b4/poetry_bumpversion-0.3.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "0f5ccec670e30fe224109e4abfa9977311b0881b963f13ebd55a88aec5c71338",
"md5": "5516a134088a0ff3b540b0d9b56c989a",
"sha256": "6a8d6917d5a56b74d8edfc29badf1500b1f50aa43538d36b17495b41355a8b7a"
},
"downloads": -1,
"filename": "poetry_bumpversion-0.3.2.tar.gz",
"has_sig": false,
"md5_digest": "5516a134088a0ff3b540b0d9b56c989a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8,<4.0",
"size": 5687,
"upload_time": "2023-12-12T09:15:30",
"upload_time_iso_8601": "2023-12-12T09:15:30.861414Z",
"url": "https://files.pythonhosted.org/packages/0f/5c/cec670e30fe224109e4abfa9977311b0881b963f13ebd55a88aec5c71338/poetry_bumpversion-0.3.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-12-12 09:15:30",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "monim67",
"github_project": "poetry-bumpversion",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "poetry-bumpversion"
}