-
-
Notifications
You must be signed in to change notification settings - Fork 278
prerelease can't comply with the semver.org specification #150
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
Comments
Thanks for reporting this issue. The main problem, I think, arises because we are using PEP0440 for anything else than the mandatory parts of the version. In order to fix this properly, I think we should move fully to a semver package. But this will be scheduled for 2.0 to avoid breaking compatibility. Regards! |
Thx @woile! FYI, for now, my workaround is to add a semver.org compliant tag after having run So, for example : cz bump -pr rc --increment MAJOR
git tag v1.0.0-rc.0 v1.0.0rc0
git push --follow-tags This is because |
I've run some tests and semver from poetry will be useful:
It will be some work to refactor, but doable. |
I personally like more PEP440. Although it has less hype, it has some features semver lacks. Wouldn't it make sense to configure commitizen's versioning scheme? There are more already, and nobody knows which will be world's favorite tomorrow... Note: in one project I run, we were using semver before, and we switched to PEP440 later. IMHO if a tag doesn't fit into the chosen versioning schema, commitizen shouldn't die. It should just skip it. |
Is there a workaround besides forking the repo and customizing the code to my needs? |
I see this has been opened for 2 years, is there any way to configure the regex that decides which prerelease is acceptable? |
Unfortunately I haven't had time to work on this, and I've just recently started working on this. But I do want to have it, because it will play well with tools that use semver like rust ecosystem or helm charts. |
hello @woile Or atmost a method to add the dash (-) on the tag_format just when prereleace is present? and a method to add custom prereleases keywords? And thanks. Is hard find a tool that concider all versioning cases. For our needs we droped various other tools before, and commitizen aparently is the tool that best fit into our needs; excepting for these small drawbacks. |
I know, and I apologize, I just haven't had the bandwith. My intention is still to add semver. The tool I was considering before was deprecated. But there's another one I found semver |
Just adding my voice to this. I build small rust applications and automating the release with commitizen has been very helpful This will make my life so much easier. |
This has been released with v3. https://commitizen-tools.github.io/commitizen/bump/#version_type More info on the release page: For rust users, the version provider might also be interesting. Commitizen can use the version on cargo as the source of truth |
Commitizen only implements the normalized PEP-440 prerelease format, excluding separators between :
Therefore, when using the
bump
command, we can't define a version format which complies with the one defined by the semver.org specification :consequences
cz bump
can't be used for prereleases alongside tools that follow this specification.Especially, this leads to an error when using the Node.js semver package.
Yet, this package is used by a bunch of other tools, like Github Automatic Release (see error message below) and conventional-changelog.
details
When adding a hyphen between
patch
andrelease
in the configuration, it appears in all version numbers, including not prerelease ones (e.g.v1.2.3-
instead ofv1.2.3
).In addition, there doesn't seem to be any way to add a separator (dot) between the prerelease signifier and the numeral.
The text was updated successfully, but these errors were encountered: