Metadata-Version: 2.4
Name: poetry-plugin-gitversion
Version: 0.1.6
Summary: This plugins wrap the gitversion tool to automatically create versions for poetry modules.
Author: Oliver Wagner
Author-email: oliver@wagner-www.de
Requires-Python: >=3.13,<4.0
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Description-Content-Type: text/markdown

# poetry gitversion

This plugin is created to integrate [gitversion](https://gitversion.net/) with [poetry](https://python-poetry.org/). 
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](https://gitversion.net/docs/usage/installation).
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](https://pypi.org/), using the following command:

```bash
$ 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:

```yaml
# 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.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
