Skip to main content

Plugin for release management in projects based on Poetry

Project description

CI PyPi Package

Release managment plugin for poetry

The project is currently under development and is not ready for use in production.

Inspired by cargo-release

Features

  • Semver support

  • Creating git tag and commits after release

  • Changelog support

Installation

Note: Plugins work at Poetry with version 1.2.0 or above.

You can install plugin via poetry

poetry self add poetry-release

or via pipx inject

pipx inject poetry poetry-release

Usage

poetry release <level>

Existing levels

  • major

  • minor

  • patch

  • release (default)

  • rc

  • beta

  • alpha

Prerequisite

Your project should be managed by git.

Config

Replacements

Poetry-release supports two types of release replacements:

  1. By Regex
    You can create replacements in files using regular expressions:
    release-replacements = [
        { file="CHANGELOG.md", pattern="\\[Unreleased\\]", replace="[{version}] - {date}" },
    ]
  2. 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

Templates

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

Release settings

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

Default git messages

  • 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}

Example

[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

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-release-0.3.1.tar.gz (10.6 kB view details)

Uploaded Source

Built Distribution

poetry_release-0.3.1-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

Details for the file poetry-release-0.3.1.tar.gz.

File metadata

  • Download URL: poetry-release-0.3.1.tar.gz
  • Upload date:
  • Size: 10.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.3

File hashes

Hashes for poetry-release-0.3.1.tar.gz
Algorithm Hash digest
SHA256 8dabb8d9a65fe23f23486977cbae14831399d4e32e41b4eb152f08e447eaa654
MD5 a15d9e92ec4a6a5cf7d4905888d08f4f
BLAKE2b-256 916cb65de5ff4b4b537f81097ca0004835a402b8de86b8395c7a67adc9910d51

See more details on using hashes here.

File details

Details for the file poetry_release-0.3.1-py3-none-any.whl.

File metadata

File hashes

Hashes for poetry_release-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 869c19d46e4cf9eb31660159cb17f782630f6e4089bb8827a33a984698c60db3
MD5 b03ed93fe53d1b47771dcce1beadb8d0
BLAKE2b-256 08e49b711766a53849ff43e7eb5706fff62f7e211e932b97726b93d3c1fd6c83

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