Skip to content

Commit

Permalink
#98: Add 'strict 'option
Browse files Browse the repository at this point in the history
  • Loading branch information
mtkennerly committed Nov 7, 2022
1 parent 973ac70 commit 2d683a7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Added:
* The plugin now prints a warning if its configuration is invalid.
Right now, this just checks for unknown keys.
* A `strict` option to prevent falling back to `0.0.0` when there are no tags.
* Changed:
* Updated Dunamai to 1.14.0+ for the latest features.
This adds support for VCS archival files, namely ones produced by `git archive` and `hg archive`.
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,8 @@ In your pyproject.toml file, you may configure the following options:
current branch. This is only used for Git currently.
* `full-commit` (boolean, default: false): If true, get the full commit hash
instead of the short form. This is only used for Git and Mercurial.
* `strict` (boolean, default: false):
If true, then fail instead of falling back to 0.0.0 when there are no tags.
* `[tool.poetry-dynamic-versioning.substitution]`: Insert the dynamic version
into additional files other than just pyproject.toml. These changes will be
reverted when the plugin deactivates.
Expand Down
2 changes: 2 additions & 0 deletions poetry_dynamic_versioning/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ def _default_config() -> Mapping:
"full-commit": False,
"tag-branch": None,
"tag-dir": "tags",
"strict": False,
}
}
}
Expand Down Expand Up @@ -200,6 +201,7 @@ def _get_version(config: Mapping) -> str:
config["tag-dir"],
config["tag-branch"],
config["full-commit"],
config["strict"],
)

if config["format-jinja"]:
Expand Down

0 comments on commit 2d683a7

Please sign in to comment.