Closed kzych-inpost closed 1 week ago
You might wanna check your tag format. The default (via Dunamai) is:
(?x) (?# ignore whitespace)
^v((?P<epoch>\d+)!)?(?P<base>\d+(\.\d+)*) (?# v1.2.3 or v1!2000.1.2)
([-._]?((?P<stage>[a-zA-Z]+)[-._]?(?P<revision>\d+)?))? (?# b0)
(\+(?P<tagged_metadata>.+))?$
So a v
prefix is expected. You can change this with the pattern
setting.
Yes, with the v
prefix it works indeed!
❯ git tag "v0.7.4"
❯ poetry version -s
0.7.4
However, I have a trouble setting any other pattern (as you suggested) - I keep getting errors:
❯ poetry version -s
Version '^\d+\.\d+\.\d+$' does not conform to the Semantic Versioning style
or after disabling the style = "semver"
:
❯ poetry version -s
Invalid PEP 440 version: '^\d+\.\d+\.\d+$'
Hi! Could you share your updated config with the pattern
field? Since there's a built-in pattern for this, it should look like:
[tool.poetry-dynamic-versioning]
enable = true
pattern = "default-unprefixed"
I would also add, that although I've installed the plugin as mentioned above, straightforward uninstalling leads to an error
The [plugin]
optional feature is only used when installing - it's not part of the package name itself. When uninstalling, you just specify the base package name without any optional features.
Thank you @mtkennerly, after your remark I changed pyproject.toml
:
[tool.poetry-dynamic-versioning]
enable = true
vcs = "git"
style = "semver"
pattern = "default-unprefixed"
and it works like I intended to :)
❯ git tag --points-at HEAD | cat
1.2.3
❯ poetry version -s
1.2.3
I would only suggest to update README.md
to make it more obvious for other users?
Added an example :)
Hi, I have my
poetry
(1.8.3
) installed withpipx
. I installed the plugin using:and modified
pyproject.toml
:Although the plugin works, it does not detect tags, only appends the commit hash:
I would also add, that although I've installed the plugin as mentioned above, straightforward uninstalling leads to an error:
Only this works:
Do you have any idea what is the cause of this behaviour?