Metadata-Version: 2.4
Name: poetry-plugin-gitversion
Version: 0.1.5
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.

## Installation

If the plugin is released on [pypi](https://pypi.org/), you can install it with the following command:

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

```bash
[[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.

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

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

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