Skip to content

FIX: Handle None version in module_available()#11416

Open
C1-BA-B1-F3 wants to merge 1 commit into
pydata:mainfrom
C1-BA-B1-F3:fix-module-available-none-version
Open

FIX: Handle None version in module_available()#11416
C1-BA-B1-F3 wants to merge 1 commit into
pydata:mainfrom
C1-BA-B1-F3:fix-module-available-none-version

Conversation

@C1-BA-B1-F3

Copy link
Copy Markdown

Fixes #11344

Problem

When returns (e.g., for modules without version metadata in certain environments like QGIS), the function raises a when trying to create a object with .

Solution

Added a check for version and returns when is specified but no version metadata is available.

Changes

  • : Added check for version before comparing with
  • : Added tests for function including regression test for this issue

Testing

  • All existing tests pass
  • New tests added to verify the fix
  • Regression test specifically for this issue

Co-authored-by: Claude noreply@anthropic.com

@github-actions github-actions Bot added the topic-NamedArray Lightweight version of Variable label Jun 26, 2026
When importlib.metadata.version() returns None (e.g., for modules without
version metadata in certain environments like QGIS), the module_available()
function would raise a TypeError when trying to create a Version object with
None.

This fix adds a check for None version and returns False when minversion is
specified but no version metadata is available.

Co-authored-by: Claude <noreply@anthropic.com>
@C1-BA-B1-F3 C1-BA-B1-F3 force-pushed the fix-module-available-none-version branch from 0e3b047 to 8f5dd3f Compare June 26, 2026 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic-NamedArray Lightweight version of Variable

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Load failure (in rain to flood toolkit)

1 participant