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
Using packaging.version.parse to parse the multipass version '1.15.0-dev.2929.pr661' raises an InvalidVersion, which isn't caught and bubbles up.
We might be able to work around this by replacing hyphens with periods, turning semver strings into pypa compliant versions. Otherwise, we could truncate at the first hyphen and attempt to use that, perhaps with a warning.
Regardless, we should catch the InvalidVersion error and replace it with something nicer.
To Reproduce
Use that version of multipass on a mac
part yaml
n/a
Relevant log output
2024-09-24 19:00:16.880 Executing on host: multipass version
2024-09-24 19:00:16.926 charmcraft internal error: InvalidVersion("Invalid version: '1.15.0-dev.2929.pr661'")
2024-09-24 19:00:16.928 Traceback (most recent call last):
2024-09-24 19:00:16.928 File "/Users/X/.pyenv/versions/3.10.11/envs/charms/lib/python3.10/site-packages/craft_application/application.py", line 543, in run
2024-09-24 19:00:16.928 self.run_managed(platform, build_for)
2024-09-24 19:00:16.928 File "/Users/X/.pyenv/versions/3.10.11/envs/charms/lib/python3.10/site-packages/charmcraft/application/main.py", line 154, in run_managed
2024-09-24 19:00:16.928 super().run_managed(platform, build_for)
2024-09-24 19:00:16.928 File "/Users/X/.pyenv/versions/3.10.11/envs/charms/lib/python3.10/site-packages/craft_application/application.py", line 368, in run_managed
2024-09-24 19:00:16.928 with self.services.provider.instance(
2024-09-24 19:00:16.928 File "/Users/X/.pyenv/versions/3.10.11/lib/python3.10/contextlib.py", line 135, in __enter__
2024-09-24 19:00:16.928 return next(self.gen)
2024-09-24 19:00:16.928 File "/Users/X/.pyenv/versions/3.10.11/envs/charms/lib/python3.10/site-packages/charmcraft/services/provider.py", line 119, in instance
2024-09-24 19:00:16.928 with super().instance(
2024-09-24 19:00:16.928 File "/Users/X/.pyenv/versions/3.10.11/lib/python3.10/contextlib.py", line 135, in __enter__
2024-09-24 19:00:16.928 return next(self.gen)
2024-09-24 19:00:16.928 File "/Users/X/.pyenv/versions/3.10.11/envs/charms/lib/python3.10/site-packages/craft_application/services/provider.py", line 126, in instance
2024-09-24 19:00:16.928 provider.ensure_provider_is_available()
2024-09-24 19:00:16.928 File "/Users/X/.pyenv/versions/3.10.11/envs/charms/lib/python3.10/site-packages/craft_providers/multipass/multipass_provider.py", line 165, in ensure_provider_is_available
2024-09-24 19:00:16.928 ensure_multipass_is_ready()
2024-09-24 19:00:16.928 File "/Users/X/.pyenv/versions/3.10.11/envs/charms/lib/python3.10/site-packages/craft_providers/multipass/_ready.py", line 41, in ensure_multipass_is_ready
2024-09-24 19:00:16.928 if not multipass.is_supported_version():
2024-09-24 19:00:16.928 File "/Users/X/.pyenv/versions/3.10.11/envs/charms/lib/python3.10/site-packages/craft_providers/multipass/multipass.py", line 161, in is_supported_version
2024-09-24 19:00:16.928 return packaging.version.parse(version) >= minimum_version
2024-09-24 19:00:16.928 File "/Users/X/.pyenv/versions/3.10.11/envs/charms/lib/python3.10/site-packages/packaging/version.py", line 56, in parse
2024-09-24 19:00:16.928 return Version(version)
2024-09-24 19:00:16.928 File "/Users/X/.pyenv/versions/3.10.11/envs/charms/lib/python3.10/site-packages/packaging/version.py", line 202, in __init__
2024-09-24 19:00:16.928 raise InvalidVersion(f"Invalid version: '{version}'")
2024-09-24 19:00:16.928 packaging.version.InvalidVersion: Invalid version: '1.15.0-dev.2929.pr661'
2024-09-24 19:00:16.928 Full execution log: '/Users/X/Library/Logs/charmcraft/charmcraft-20240924-190016.856344.log'
The text was updated successfully, but these errors were encountered:
Bug Description
See: canonical/charmcraft#1917
Using
packaging.version.parse
to parse the multipass version'1.15.0-dev.2929.pr661'
raises anInvalidVersion
, which isn't caught and bubbles up.We might be able to work around this by replacing hyphens with periods, turning semver strings into pypa compliant versions. Otherwise, we could truncate at the first hyphen and attempt to use that, perhaps with a warning.
Regardless, we should catch the
InvalidVersion
error and replace it with something nicer.To Reproduce
Use that version of multipass on a mac
part yaml
Relevant log output
The text was updated successfully, but these errors were encountered: