mtkennerly / dunamai

Dynamic versioning library and CLI
https://dunamai.readthedocs.io/en/latest
MIT License
320 stars 23 forks source link

Bump behavior different between `dunamai` and `poetry-dynamic-versioning` #45

Closed mcous closed 2 years ago

mcous commented 2 years ago

Hi! I'm interested in integrating dunamai into the CI pipeline of some projects to do continuous deployment of prereleases and releases. Since my project adheres to semver, I want to use --bump to create prerelease versions rather than postrelease versions, which semver doesn't understand (this seems to be the reason --bump was introduced)

However, when I was playing around with --bump, I encountered something unexpected: running dunamai from git --style semver --bump on a tagged commit bumps to the next patch version rather than returning the tag version unchanged. Is this an intentional behavior?

When I went to look at poetry-dynamic-versioning, I noticed this in the documentation (emphasis mine):

bump: Boolean. Default: false. If true, then increment the last part of the version base by 1, unless the stage is set, in which case increment the revision by 1 or set it to a default of 2 if there was no revision. Does nothing when on a commit with a version tag.

Should this be the behavior of the dunamai library itself? I would prefer it, because it would allow me to put dunamai ... --bump in my CI scripts to produce both release and pre-release version strings.

mtkennerly commented 2 years ago

Thanks for pointing this out. I would say this is an oversight in Dunamai.

mtkennerly commented 2 years ago

This is now fixed in v1.11.1.