Skip to content

Commit

Permalink
Attempts to get dynamic versioning to output something semver
Browse files Browse the repository at this point in the history
  • Loading branch information
emlowe committed Jul 9, 2024
1 parent ac84e83 commit db95c55
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -119,17 +119,26 @@ legacy_keyring = ["keyrings.cryptfile"]
[tool.poetry-dynamic-versioning]
enable = true
vcs = "git"
dirty = true
pattern = "default-unprefixed"
# format-jinja = "{% if distance == 0 %}{{ base }}{% else %}{{ base }}.dev{{ distance }}{% endif %}{% if dirty %}+dirty{% endif %}"
format-jinja = """
{%- if distance == 0 -%}
{{ serialize_pep440(base, stage, revision) }}
{%- if stage is none -%}
{{ base }}
{%- else -%}
{{ base }}-{{stage}}{{revision}}
{%- endif -%}
{%- else -%}
{{ serialize_pep440(base, stage, revision, dev=distance) }}
{{ base }}-{{stage}}{{revision}}.dev{{ distance }}
{%- endif -%}
"""
style = "pep440"
#format-jinja = """
# {%- if distance == 0 -%}
# {{ serialize_pep440(base, stage, revision) }}
# {%- else -%}
# {{ serialize_pep440(base, stage, revision, dev=distance) }}
# {%- endif -%}
#"""
style = "semver"
bump = true

[build-system]
Expand Down

0 comments on commit db95c55

Please sign in to comment.