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

Make version-checking compatible with updated Packaging library. #9

Merged
merged 1 commit into from
Dec 13, 2022

Conversation

avnishks
Copy link
Collaborator

Recently the packaging library removed the LegacyVersion class after nearly two years of deprecation warning [1]. This has resulted in Surfa's setup.py script throwing the following error at installation time:
AttributeError: module 'packaging.version' has no attribute 'LegacyVersion'

Proposed fix:
Instead of checking if the (parsed) version string is a LegacyVersion object, use the packaging.version.parse(version) function to parse the version string and catch any InvalidVersion exception. If an exception is raised, then its not a valid version string according to the PEP 440 specification.

[1] pypa/packaging#530

@avnishks avnishks merged commit ef8d4e5 into freesurfer:master Dec 13, 2022
@pombredanne
Copy link

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

Successfully merging this pull request may close these issues.

2 participants