Skip to content

Commit 0ac2ca7

Browse files
version
1 parent e86ab41 commit 0ac2ca7

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

pyproject.toml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,13 @@ build-backend = "poetry_dynamic_versioning.backend"
4747
[tool.poetry-dynamic-versioning]
4848
enable = true
4949
vcs = "git"
50-
pattern = "^(?P<base>\\d+\\.\\d+\\.\\d+)(-?((?P<stage>[a-zA-Z]+)\\.?(?P<revision>\\d+)?))?"
50+
style = "pep440"
5151
format-jinja = """
5252
{%- if distance == 0 -%}
53-
{{- base -}}
53+
{{ serialize_pep440(base, stage, revision) }}
54+
{%- elif revision is not none -%}
55+
{{ serialize_pep440(base, stage, revision + 1, dev=distance) }}
5456
{%- else -%}
55-
{{- base }}.dev{{ distance }}+g{{commit}}
57+
{{ serialize_pep440(bump_version(base), stage, revision, dev=distance) }}
5658
{%- endif -%}
5759
"""

0 commit comments

Comments
 (0)