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.

Installation

If the plugin is released on pypi, you can install it with the following command:

$ poetry self add poetry-plugin-gitversion

But at the moment it's just released on my private pypi server, so you have to add the repository first. This is not that easy, because poetry self add does not support --repository yet, so you have to add the repository to your poetry config first.

Find the config location with: poetry config --list --local and use the data-dir directory. This directory will contain a pyproject.toml file, where you need to add the repository:

[[tool.poetry.source]]
name = "bls19"
url = "https://pypi.bls19.de/simple"
priority = "supplemental"

After you did this, you can install the plugin with the command from above.

Configuration

For versions working with poetry/python, it's recommended to configure gitversion. You can do this by creating a GitVersion.yml file in the root of your project.

# 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
  • ...

Debug/use this plugin inside this project

With this command you apply the plugin to this project and you can test it. But it works only if the project is cloned into the directory poetry_plugin_gitversion.git, if not the plugin will not be activated.

$ poetry env activate
PoetryGitVersion: Poetry GitVersion-Plugin aktiviert
GitVersion: Version auf 0.1.4-beta.2 gesetzt
source /Users/my_user/development/github/poetry_plugin_gitversion.git/.venv/bin/activate

Now the version will be returned by poetry version and poetry build will use this version.

Release history

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.5.tar.gz (2.6 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.5-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: poetry_plugin_gitversion-0.1.5.tar.gz
  • Upload date:
  • Size: 2.6 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.5.tar.gz
Algorithm Hash digest
SHA256 3e855249b62f33228ea1295abafecd42a5d1b6323823a3368ba59317741bcf1b
MD5 654a3b206f96bd95b71db74fc338b2af
BLAKE2b-256 ed07cda20e42a9cdb0df57210dda8b66b8c3f9f2b1242816c5ae27792f0e1cd9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for poetry_plugin_gitversion-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 183cf21c7a53da872b33f90fc16f2dbcbcfac62f4abecdb1931706e880d6b48a
MD5 9b700ff17d6552027032d83444ce2e1c
BLAKE2b-256 736d019d83b43580c7af73cee371f493bf6e5315d751329bd78635b4c4bea20b

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