Skip to content
Snippets Groups Projects
Commit 3489c033 authored by Randrianarisona Aaron's avatar Randrianarisona Aaron
Browse files

updated README.md

parent 664084c6
No related branches found
Tags v1.0.3
No related merge requests found
Pipeline #39213 failed with stages
in 9 seconds
......@@ -126,9 +126,12 @@ run tests:
## poetry-dynamic-versioning configuration
- pour ajouter le plugin poetry-dynamic-versioning au projet:
- pour ajouter le plugin poetry-dynamic-versioning au projet et le verifier:
```
sudo poetry self add "poetry-dynamic-versioning[plugin]"
sudo poetry self add "poetry-dynamic-versioning[plugin]"
pip install poetry-dynamic-versioning
poetry self show
poetry dynamic-versioning --help
```
À ajouter dans pyproject.toml :
......@@ -137,40 +140,14 @@ sudo poetry self add "poetry-dynamic-versioning[plugin]"
enable = true
[build-system]
requires = ["poetry-core>=1.2", "poetry-dynamic-versioning>=1.0.0,<2.0.0"]
requires = ["poetry-core>=1.3", "poetry-dynamic-versioning>=1.0.0,<2.0.0"]
build-backend = "poetry_dynamic_versioning.backend"
```
pour specifier le pattern à utiliser pour le numéro de version , dans pyproject.toml:
```
[build-system]
pattern = """(?x) (?# ignore whitespace)
^v?((?P<epoch>\\d+)!)?(?P<base>\\d+(\\.\\d+)*) (?# 1.2.3 or 1!2000.1.2)
([-._]?((?P<stage>[a-zA-Z]+)[-._]?(?P<revision>\\d+)?))? (?# b0)
(\\+(?P<tagged_metadata>.+))?$ (?# +linux)
"""
# version format
format-jinja = """
{%- set epoch = epoch if epoch|length else none -%}
{%- if distance == 0 -%}
{{- serialize_pep440(base, stage, revision, epoch=epoch) -}}
{%- elif stage is not none -%}
{{- serialize_pep440(base, stage, revision if revision else 0, epoch=epoch, post=distance, dev=0, metadata=[commit]) -}}
{%- elif branch.startswith('main/') -%}
{{- serialize_pep440(branch['hotfix/' | length:], 'a', 0, epoch=epoch, dev=distance, metadata=[commit]) -}}
{%- elif branch.startswith('hotfix/') -%}
{{- serialize_pep440(branch['hotfix/' | length:], 'a', 0, epoch=epoch, dev=distance, metadata=[commit]) -}}
{%- elif branch.startswith('release/') -%}
{{- serialize_pep440(branch['release/' | length:], 'a', 0, epoch=epoch, dev=distance, metadata=[commit]) -}}
{%- elif branch.startswith('feature/') -%}
{{- serialize_pep440(base, stage, revision, epoch=epoch, post=distance, dev=0, metadata=[branch_escaped['feature' | length:][:16], commit]) -}}
{%- else -%}
{{- serialize_pep440(base, stage, revision, epoch=epoch, post=distance, dev=0, metadata=[commit]) -}}
{%- endif -%}
"""
```
sur gitlab, les tags doit etre de la forme "v1.0.0", en commençant par un "v"
Puis pour le build et obtenir le dossier dist:
```
poetry install
poetry build
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment