Skip to main content
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 Status Python Versions PyPI version Licence

Getting Started

Prerequisites

  • python = ^3.10

  • poetry = ^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

__version__ = "0.1.0" # It MUST match the version in pyproject.toml file

Add the following to your pyproject.toml file.

[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

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

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

License

This project is licensed under MIT License - see the LICENSE file for details.

Download files

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

Source Distribution

poetry_bumpversion-0.4.0.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

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

poetry_bumpversion-0.4.0-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file poetry_bumpversion-0.4.0.tar.gz.

File metadata

  • Download URL: poetry_bumpversion-0.4.0.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for poetry_bumpversion-0.4.0.tar.gz
Algorithm Hash digest
SHA256 a34e2cc97c549af6cdc3a7584e3ffab3b778afad01458ad37da4e7a91a1286e4
MD5 e161fb1e9b009abffa4e5b83335cfa7c
BLAKE2b-256 6972a1b3c0c29ed8c64d95ac384ba24df89a2db6e6fcc8620a68f27139cbd79f

See more details on using hashes here.

Provenance

The following attestation bundles were made for poetry_bumpversion-0.4.0.tar.gz:

Publisher: deploy.yml on monim67/poetry-bumpversion

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file poetry_bumpversion-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for poetry_bumpversion-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 40407c1420f136bc97448f2d8f49b60cb01703496cb815b4537d92a8b70fd5e6
MD5 57a31adb1c3f6acd7e5f31f661eccabe
BLAKE2b-256 12bb12db1f8aa09df79935fe1bff023f8adc5bce5b79d287ee5357e0db6759af

See more details on using hashes here.

Provenance

The following attestation bundles were made for poetry_bumpversion-0.4.0-py3-none-any.whl:

Publisher: deploy.yml on monim67/poetry-bumpversion

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 files

0.3.3

2 files

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

0.2.0

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page