Skip to content
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

cz bump cannot find version scheme "semver" after upgrade #841

Closed
snellejelle99 opened this issue Sep 11, 2023 · 6 comments
Closed

cz bump cannot find version scheme "semver" after upgrade #841

snellejelle99 opened this issue Sep 11, 2023 · 6 comments

Comments

@snellejelle99
Copy link

Description

After upgrading from 3.8.0 to 3.8.2 i get the following error:

$ cz bump --dry-run
Version scheme "semver" unknown.

Steps to reproduce

  1. pip install commitizen --upgrade
  2. cz bump --dry-run

Current behavior

The following error is given:
Version scheme "semver" unknown.

Desired behavior

cz bump works as its supposed to

Screenshots

No response

Environment

$ cz version
3.8.2

$ python --version
Python 3.11.5

$ python -c "import platform; print(platform.system())"
Windows

$ cz version --report
Commitizen Version: 3.8.2
Python Version: 3.11.5 (tags/v3.11.5:cce6ba9, Aug 24 2023, 14:38:34) [MSC v.1936 64 bit (AMD64)]
Operating System: Windows

YAML config:

---
commitizen:
  name: cz_conventional_commits
  tag_format: v$major.$minor.$patch$prerelease.$devrelease
  version: 2.0.2
  version_files:
  - source/OptionsManager/OptionMacros.h:FIRMWARE_VERSION_CSTRING
  - source/doxygen/Doxyfile:PROJECT_NUMBER
  version_scheme: semver
  update_changelog_on_bump: true
  changelog_merge_prerelease: true
  changelog_incremental: true
@snellejelle99
Copy link
Author

snellejelle99 commented Sep 11, 2023

Tried solutions:
Running pip install --upgrade --force-reinstall commitizen does not fix the issue.
Running pip install --upgrade --force-reinstall commitizen==3.8.0 to revert also does not fix the issue.

Removing version_scheme: semver from cz.yaml results in

cz bump --dry-run
Version Provider "commitizen" unknown.

cz changelog and cz version -p also result in the same errors.

Could #830 have caused this issue?

Debug output:

cz --debug version -p
Version Provider "commitizen" unknown.
Traceback (most recent call last):
  File "C:\Python311\Lib\site-packages\commitizen\providers\__init__.py", line 42, in get_provider
    (ep,) = metadata.entry_points(name=provider_name, group=PROVIDER_ENTRYPOINT)
    ^^^^^
ValueError: too many values to unpack (expected 1)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Python311\Scripts\cz.exe\__main__.py", line 7, in <module>
  File "C:\Python311\Lib\site-packages\commitizen\cli.py", line 463, in main
    args.func(conf, vars(args))()
  File "C:\Python311\Lib\site-packages\commitizen\commands\version.py", line 25, in __call__
    version = get_provider(self.config).get_version()
              ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\site-packages\commitizen\providers\__init__.py", line 44, in get_provider
    raise VersionProviderUnknown(f'Version Provider "{provider_name}" unknown.')
commitizen.exceptions.VersionProviderUnknown: Version Provider "commitizen" unknown.

C:\Users\Jelle\Documents\GITREPOS\timeseal-ecu-firmware-phase-b>

@snellejelle99
Copy link
Author

The problem seems to be caused by the remnants of the previous version left behind by PIP.
Deleting these folders from the pip installation directory fixes the issue.
Screenshot 2023-09-12 105240

I'm not sure if this is Pip issue or if it can be fixed here.

@Lee-W
Copy link
Member

Lee-W commented May 20, 2024

It looks like an environmental issue to me 🤔 I've just tested it with the latest version without encountering a problem. I'm going to close this one. But feel free to reopen it if this issue still persists 🙂

@Lee-W Lee-W closed this as completed May 20, 2024
@snellejelle99
Copy link
Author

@Lee-W Did you test under windows or linux?

@Lee-W
Copy link
Member

Lee-W commented May 21, 2024

No, I do not have one to test it. @snellejelle99 Does it still happen on your end?

@snellejelle99
Copy link
Author

snellejelle99 commented May 23, 2024

@Lee-W I just updated under windows using pip to 3.27.
No issues on my end. So it seems to be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants