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

Mantid Imaging not starting packaging.version.InvalidVersion #1652

Closed
samtygier-stfc opened this issue Jan 3, 2023 · 2 comments · Fixed by #1653
Closed

Mantid Imaging not starting packaging.version.InvalidVersion #1652

samtygier-stfc opened this issue Jan 3, 2023 · 2 comments · Fixed by #1653

Comments

@samtygier-stfc
Copy link
Collaborator

Summary

Mantid Imaging unstable is not starting on IDAaaS.

File "/opt/mambaforge/envs/mantidimaging_unstable/lib/python3.9/site-packages/mantidimaging/core/utility/version_check.py", line 147, in _parse_version
    return version.parse(normalised_version_string)
  File "/opt/mambaforge/envs/mantidimaging_unstable/lib/python3.9/site-packages/packaging/version.py", line 52, in parse
    return Version(version)
  File "/opt/mambaforge/envs/mantidimaging_unstable/lib/python3.9/site-packages/packaging/version.py", line 197, in __init__
    raise InvalidVersion(f"Invalid version: '{version}'")
packaging.version.InvalidVersion: Invalid version: '2.5.0a1.390'

Steps To Reproduce

On IDAaaS launch Mantid Imaging Unstable

Context

Current unstable

Failure Logs

See above

@samtygier-stfc
Copy link
Collaborator Author

Looks like this was caused by the packaging package updating to 22.0. Specifically dropping LegacyVersion (see pypa/packaging#407 ).

We use 2.5.0a1_390 to signify 390 commits since the 2.5.0a1 tag. We convert the underscore to a dot before parsing. I'm not sure why we never saw a deprecation warning here.

Looking at https://peps.python.org/pep-0440/ we should probably be using a post release here. (dev would sort these before the tagged version). Lets swap the _ to a - as a compact form of post. Should probably bump a1 to a2 to make sure there is no wrong sorting.

@samtygier-stfc
Copy link
Collaborator Author

Conda-build does not accept hyphens in the version name, so need to use post.

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

Successfully merging a pull request may close this issue.

1 participant