bioio-devs / bioio

Image reading, metadata management, and image writing for Microscopy images in Python
https://bioio-devs.github.io/bioio/OVERVIEW.html
BSD 3-Clause "New" or "Revised" License
55 stars 4 forks source link

Bioio plugin dump unable to report plugins #57

Closed BrianWhitneyAI closed 4 months ago

BrianWhitneyAI commented 4 months ago

Describe the Bug

When using bioio.plugins.dump() the list of plugins cannot be reported due to a KeyError: 'author'. I believe this issue is also effecting the determine_plugin method.

Reproduction

Created a python 3.10 virtual env and pip install bioio bioio-ome-tiff. You need to install one of the plugins to see this bug but any of them seem to reporduce.

import bioio

bioio.plugins.dump_plugins()

Output

---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
/allen/aics/microscopy/brian_whitney/repos/bioio/test.py in line 3
      [1](file:///allen/aics/microscopy/brian_whitney/repos/bioio/test.py?line=0) import bioio
      [2](file:///allen/aics/microscopy/brian_whitney/repos/bioio/test.py?line=1) from bioio_ome_tiff import Reader
----> [3](file:///allen/aics/microscopy/brian_whitney/repos/bioio/test.py?line=2) bioio.plugins.dump_plugins()

File /allen/aics/microscopy/brian_whitney/repos/bioio/bioio/plugins.py:255, in dump_plugins()
    [253](file:///allen/aics/microscopy/brian_whitney/repos/bioio/bioio/plugins.py?line=252) dist = ep.dist
    [254](file:///allen/aics/microscopy/brian_whitney/repos/bioio/bioio/plugins.py?line=253) if dist is not None:
--> [255](file:///allen/aics/microscopy/brian_whitney/repos/bioio/bioio/plugins.py?line=254)     print(f"  Author  : {dist.metadata['author']}")
    [256](file:///allen/aics/microscopy/brian_whitney/repos/bioio/bioio/plugins.py?line=255)     print(f"  Version : {dist.version}")
    [257](file:///allen/aics/microscopy/brian_whitney/repos/bioio/bioio/plugins.py?line=256)     print(f"  License : {dist.metadata['license']}")

File [~/.pyenv/versions/bioio-import-bug/lib/python3.10/site-packages/importlib_metadata/_adapters.py:54](https://vscode-remote+ssh-002dremote-002bdev-002daics-002dbwp-002d001-002ecorp-002ealleninstitute-002eorg.vscode-resource.vscode-cdn.net/allen/aics/microscopy/brian_whitney/repos/bioio/~/.pyenv/versions/bioio-import-bug/lib/python3.10/site-packages/importlib_metadata/_adapters.py:54), in Message.__getitem__(self, item)
     [52](file:///home/brian.whitney/.pyenv/versions/bioio-import-bug/lib/python3.10/site-packages/importlib_metadata/_adapters.py?line=51) res = super().__getitem__(item)
     [53](file:///home/brian.whitney/.pyenv/versions/bioio-import-bug/lib/python3.10/site-packages/importlib_metadata/_adapters.py?line=52) if res is None:
---> [54](file:///home/brian.whitney/.pyenv/versions/bioio-import-bug/lib/python3.10/site-packages/importlib_metadata/_adapters.py?line=53)     raise KeyError(item)
     [55](file:///home/brian.whitney/.pyenv/versions/bioio-import-bug/lib/python3.10/site-packages/importlib_metadata/_adapters.py?line=54) return res

KeyError: 'author'

Environment

Python 3.10 Installs: pip install bioio bioio-ome-tiff