Skip to content

Dynamic versioning for postrelease versions #465

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Jun 4, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ classifiers = [
]
repository = "https://github.com/NNPDF/eko"
include = [
"src/eko/version.py",
"doc/source/img/Logo.png",
"src/ekobox/genpdf/templatePDF.info",
"src/ekobox/genpdf/Toy.info",
Expand Down Expand Up @@ -92,7 +93,7 @@ enable = true
vcs = "git"
style = "semver"
dirty = true
format_jinja = "{% if distance == 0 %}{{ base }}{% else %} 0.0.0.{{ commit }}{% endif %}"
format-jinja = "{% if distance == 0 %}{{ base }}{% else %}0.0.0-post.{{ distance }}+{{ commit }}{% endif %}"

[tool.poetry-dynamic-versioning.substitution]
files = ["src/eko/version.py"]
Expand Down
4 changes: 4 additions & 0 deletions src/eko/io/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ def load(cls, path: os.PathLike):
and version.minor == 0
and version.micro == 0
and version.is_postrelease
and vmod.__version__
!= f"{version.base_version}-post.{version.post}+{version.local}"
):
raise NotImplementedError(
"Unsupported version; use an eko from a published eko version!"
Expand All @@ -87,6 +89,8 @@ def load(cls, path: os.PathLike):
and version.minor == 0
and version.micro == 0
and version.is_postrelease
and vmod.__version__
!= f"{version.base_version}-post.{version.post}+{version.local}"
):
raise NotImplementedError(
"Unsupported version; use an eko from a published eko version!"
Expand Down
Loading