Skip to main content

poetry gitversion

This plugin is created to integrate gitversion with poetry. It allows you to automatically set the version of your project based on your git history.

gitversion will be used to extract the version from your git history. This plugin just take the output and set the version of your poetry project during version, publish, ... .

Installation

gitversion needs to be installed first, before you can use this plugin. You can find the installation instructions on the GitVersion website. Execute gitversion in the root directory of your GitRepository inside your terminal to check if it is installed correctly.

You can install the plugin itself from pypi, using the following command:

$ poetry self add poetry-plugin-gitversion

Configuration

To change the versioning strategy, you need to configure the gitversion application. You can create a GitVersion.yml file in the root of your project. For versions working with poetry/python, it's recommended to configure gitversion.

The release branches can be configured in the GitVersion.yml file, for example like this:

# information about configuration of GitVersion:
# https://gitversion.net/docs/reference/configuration

branches:
  release:
    mode: ContinuousDelivery
    prevent-increment:
      when-current-commit-tagged: true
    label: beta
    is-release-branch: true
    increment: Patch

This configuration will get the tagged version if the current commit is tagged, otherwise it will increment the patch version and add a beta label, followed by CommitsSinceVersionSource. That means the following order is maybe released:

  • 0.1.0
  • 0.1.1-beta.1
  • 0.1.1-beta.2
  • 0.1.1-beta.4
  • 0.1.1
  • 0.1.2-beta.1
  • 0.1.2-beta.2
  • ...

The publishing will make pypi compatible versions out of this. Something like: 0.1.1b2 for 0.1.1-beta.2.

Release history

0.1.7

  • print normal messages only in verbose mode
  • add reference to project homepage and sources
  • check if gitversion is installed and available in the PATH
  • add documentation about install the local version of the plugin on your system

0.1.6

  • optimized the README.md file to be more clear and understandable

0.1.5

  • fix imports for IO and Poetry at plugin (add cleo dependency)
  • fix io.wirte_line text format, without : behind plugin name

0.1.4

  • publish to pypi.org
  • renamed to poetry-plugin-gitversion to follow the naming convention of poetry plugins

0.1.3

  • add documentation about the installation of this plugin

0.1.2

  • initial release of the plugin that works

Download files

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

Source Distribution

poetry_plugin_gitversion-0.1.7.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

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

poetry_plugin_gitversion-0.1.7-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file poetry_plugin_gitversion-0.1.7.tar.gz.

File metadata

  • Download URL: poetry_plugin_gitversion-0.1.7.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.14.6 Darwin/25.6.0

File hashes

Hashes for poetry_plugin_gitversion-0.1.7.tar.gz
Algorithm Hash digest
SHA256 874d8da957934b1c418f2d2dd9e11cfab92e8200ec2b144917869b65ff7d53ab
MD5 b2525d12a1f5d9e63c98bdefc6d97de0
BLAKE2b-256 40a20ddae7b2662e232c7454cc6aae844eb24d9f397d3bd50adcb079cf49a9b9

See more details on using hashes here.

File details

Details for the file poetry_plugin_gitversion-0.1.7-py3-none-any.whl.

File metadata

File hashes

Hashes for poetry_plugin_gitversion-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 4e2d8e7f497fa39ab22a94eaccd975ba95cc1835facddafb78657b8f40d03dba
MD5 ae6555b99d6669eb17b558ccc38dc70b
BLAKE2b-256 0bc05a4de1971421607c539bafd93c3b98651878965505aed23b058e4fcd4103

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page