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

Bugfix: Use importlib.metadata.version instead import from _version #190

Merged
merged 3 commits into from
Nov 30, 2023

Conversation

psobolewskiPhD
Copy link
Member

Closes: #177

In this PR I get the napari version using importlib.metadata.version instead of importing from _version.
In older napari versions the variable name was different, resulting in the error shown in #177
This method should be backwards compatible for any napari on python >= 3.8
To be safe for older python also try importlib_metadata but if that doesn't work, then just note the version as older than 0.4.15, the first version to not support python 3.7.

@psobolewskiPhD psobolewskiPhD added the ready-to-merge This PR is approved and can be merged after 24 hour `cooldown` label Nov 28, 2023
@psobolewskiPhD psobolewskiPhD merged commit e79633c into napari:main Nov 30, 2023
12 checks passed
@psobolewskiPhD psobolewskiPhD deleted the fix_version_check branch November 30, 2023 16:23
@psobolewskiPhD psobolewskiPhD removed the ready-to-merge This PR is approved and can be merged after 24 hour `cooldown` label Nov 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Import Error
2 participants