You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to use cz bump with scm as provider, cz fails on get.version() if there are any tags that does not follow semver. This is probably intentional, but i would expect it to skip the faulty ones and fetch the latest real semver tags and calculate the new version from those. This seems to work fine when you use cz init and it asks "Is this the latest tag?"
Steps to reproduce
Create a faulty semver tag eg. 0.1.0-1-refs_pull_31_merge
This will yield an exception orginating from packaging/version stating it's an invalid version:
Traceback (most recent call last):
File "/opt/homebrew/bin/cz", line 8, in <module>
sys.exit(main())
^^^^^^
File "/opt/homebrew/Cellar/commitizen/3.12.0/libexec/lib/python3.12/site-packages/commitizen/cli.py", line 565, in main
args.func(conf, arguments)()
File "/opt/homebrew/Cellar/commitizen/3.12.0/libexec/lib/python3.12/site-packages/commitizen/commands/bump.py", line 136, in __call__
current_version = self.scheme(provider.get_version())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/opt/python-packaging/lib/python3.12/site-packages/packaging/version.py", line 200, in __init__
raise InvalidVersion(f"Invalid version: '{version}'")
packaging.version.InvalidVersion: Invalid version: '0.1.0-1-refs_pull_31_merge'
Desired behavior
I would like it to be able to skip the faulty ones and use the latest "ok" semver version as it seems to do when generating the toml file. Or, if a explicit version i set with
cz bump 1.0.1
Use that version and skip the check against tags altogether.
Screenshots
No response
Environment
Commitizen Version: 3.12.0
Python Version: 3.12.0 (main, Oct 5 2023, 15:44:07) [Clang 14.0.3 (clang-1403.0.22.14.1)]
Operating System: Darwin
The text was updated successfully, but these errors were encountered:
I just tested in the latest version (3.26.0) without encountering the issue (but there would still be warnings). I'm going to close this one. But please feel free to reopen it if the issue still persists. Thanks!
Description
When trying to use cz bump with scm as provider, cz fails on get.version() if there are any tags that does not follow semver. This is probably intentional, but i would expect it to skip the faulty ones and fetch the latest real semver tags and calculate the new version from those. This seems to work fine when you use cz init and it asks "Is this the latest tag?"
Steps to reproduce
Current behavior
This will yield an exception orginating from packaging/version stating it's an invalid version:
Desired behavior
I would like it to be able to skip the faulty ones and use the latest "ok" semver version as it seems to do when generating the toml file. Or, if a explicit version i set with
cz bump 1.0.1
Use that version and skip the check against tags altogether.
Screenshots
No response
Environment
Commitizen Version: 3.12.0
Python Version: 3.12.0 (main, Oct 5 2023, 15:44:07) [Clang 14.0.3 (clang-1403.0.22.14.1)]
Operating System: Darwin
The text was updated successfully, but these errors were encountered: