Release managment plugin for poetry
The project is currently under development and is not ready for use in production.
Inspired by cargo-release
Note: Plugins work at Poetry with version 1.8.3 or above.
You can install plugin via poetry
poetry self add poetry-release
or via pipx inject
pipx inject poetry poetry-release
poetry release <level>
Existing levels
- major
- minor
- patch
- release (default)
- rc
- beta
- alpha
Your project should be managed by git.
Poetry-release supports two types of release replacements:
- By RegexYou can create replacements in files using regular expressions:
release-replacements = [ { file="CHANGELOG.md", pattern="\\[Unreleased\\]", replace="[{version}] - {date}" }, ]
Message replacements
Replacement | Description |
---|---|
release-commit-message |
Message for release commit |
post-release-commit-message |
Message for post release commit(if it's allowed) |
tag-name |
The name of tag |
tag-message |
The message for tag |
Poetry-release supports templates to build releases. Templates could
be used in release replacements/messages/tags. Template is indicated
like some text {package_name}
Template | Description |
---|---|
package_name |
The name of this project in pyproject.toml |
prev_version |
The project version before release |
version |
The bumped project version |
next_version |
The version for next development iteration (alpha) |
date |
The current date in %Y-%m-%d` format |
These settings allow you to disable part of the functionality. They
can be set either in pyproject.toml
or in CLI like flag. Settings
from CLI have a higher priority
Settings | Default | CLI | pyproject.toml |
Description |
---|---|---|---|---|
disable-push |
false | yes | yes | Don't do git push |
disable-tag |
false | yes | yes | Don't do git tag |
disable-dev |
false | yes | yes | Skip bump version after release |
sign-commit |
false | no | yes | Signed commit |
sign-tag |
false | no | yes | Signed tag |
dry-run |
false | yes | no | Dry run release |
- Tag name -
{version}
- Tag message -
Released {package_name} {version}
- Release commit -
Released {package_name} {version}
- Post release commit -
Starting {package_name}'s next development iteration {next_version}
[tool.poetry-release]
release-replacements = [
{ file="CHANGELOG.md", pattern="\\[Unreleased\\]", replace="[{version}] - {date}" },
{ file="CHANGELOG.md", pattern="\\(https://semver.org/spec/v2.0.0.html\\).", replace="(https://semver.org/spec/v20.0.html).\n\n## [Unreleased]"},
]
disable-push = false
disable-tag = false
disable-dev = false
release-commit-message = "Release {package_name} {version}"
post-release-commit-message = "Start next development iteration {next_version}"
tag-name = "{version}"
sign-tag = true
sign-commit = true
poetry release minor --disable-dev --disable-tag