Skip to main content

Poetry plugin to update project version strings on poetry version command

Project description

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 Python Versions PyPI version Licence

Getting Started

Prerequisites

  • poetry = ^1.2.0a1

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

Now run poetry version patch to check if version in both pyproject.toml and your_package/__init__.py file has been updated.

You can add more files following the steps above. You can also fine 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 also 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}'

License

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

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

poetry-bumpversion-0.2.0.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

poetry_bumpversion-0.2.0-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file poetry-bumpversion-0.2.0.tar.gz.

File metadata

  • Download URL: poetry-bumpversion-0.2.0.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.0 CPython/3.8.10 Linux/5.15.0-1019-azure

File hashes

Hashes for poetry-bumpversion-0.2.0.tar.gz
Algorithm Hash digest
SHA256 3d662da26d7b42114230f7e0434c61b059aec05f5ef5c98a188d062b6079637b
MD5 a8625c78cbe7da08950048ed68ce4a85
BLAKE2b-256 bc2d865e706045c75f1e69da02a92532d1ae9e1c1bb9fcc1b86271f570c9ef1d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: poetry_bumpversion-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.0 CPython/3.8.10 Linux/5.15.0-1019-azure

File hashes

Hashes for poetry_bumpversion-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 823e47a80221a65495cd92806301ad9cf6490cfd6d1d9ae7cac6dfe512d0490b
MD5 3a1bc193285ed5d9a2b5ff702cb085bf
BLAKE2b-256 1543c00ac9b4803c1c071e6f867bc205cfee3ddfe6943413465c2f591f9af1ea

See more details on using hashes here.

Supported by

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