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
Within the last month there has been a change on how previous commits are being handled, due to which an old tag in one of my projects 1.1.0-add-semver.11.shae030cfc does cause cz bump to fail:
Traceback (most recent call last):
File "/app_venv/bin/cz", line 8, in <module>
sys.exit(main())
^^^^^^
File "/app_venv/lib/python3.12/site-packages/commitizen/cli.py", line 656, in main
args.func(conf, arguments)()
File "/app_venv/lib/python3.12/site-packages/commitizen/commands/bump.py", line 147, in __call__
current_version = self.scheme(provider.get_version())
^^^^^^^^^^^^^^^^^^^^^^
File "/app_venv/lib/python3.12/site-packages/commitizen/providers/scm_provider.py", line 21, in get_version
versions = sorted(rules.extract_version(t) for t in version_tags)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app_venv/lib/python3.12/site-packages/commitizen/providers/scm_provider.py", line 21, in <genexpr>
versions = sorted(rules.extract_version(t) for t in version_tags)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/app_venv/lib/python3.12/site-packages/commitizen/tags.py", line 151, in extract_version
return self.scheme(m.group("version"))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app_venv/lib/python3.12/site-packages/packaging/version.py", line 202, in __init__
raise InvalidVersion(f"Invalid version: {version!r}")
packaging.version.InvalidVersion: Invalid version: '1.1.0-add-semver.11.shae030cfc'
After some investigation I've learned that this is due to cz is using packaging.version.Version to parse PEP440, SemVer1 and SemVer2 with the same code although my .cz.toml is configured to semver2.
This does mean that cz is really only able to parse PEP440 compatible versions, rather than SemVer.
Does there happen to be a ticket with plans of implementing SemVer and SemVer2 parsers?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Moin,
Within the last month there has been a change on how previous commits are being handled, due to which an old tag in one of my projects
1.1.0-add-semver.11.shae030cfc
does causecz bump
to fail:After some investigation I've learned that this is due to
cz
is usingpackaging.version.Version
to parse PEP440, SemVer1 and SemVer2 with the same code although my.cz.toml
is configured tosemver2
.This does mean that cz is really only able to parse PEP440 compatible versions, rather than SemVer.
Does there happen to be a ticket with plans of implementing SemVer and SemVer2 parsers?
Beta Was this translation helpful? Give feedback.
All reactions