Pioreactor / pioreactor

Hardware and software for accessible, extensible, and scalable bioreactors. Built on Raspberry Pi.
https://pioreactor.com
MIT License
101 stars 9 forks source link

If a python-file-like plugin in `.pioreactor/plugins` has the same name as a python stdlib module, it won't be loaded. #447

Closed CamDavidsonPilon closed 1 year ago

CamDavidsonPilon commented 1 year ago

Repro:

  1. Add a python file called test.py to pioreactor/plugins with a raise ValueError.
  2. From a Python shell, run:
    from pioreactor.plugin_management import get_plugins
    get_plugins()

There will be an entry in the dict:

 'test': Plugin(module=<module 'test' from '/usr/lib/python3.11/test/__init__.py'>, description='Unknown', version='Unknown', homepage='Unknown', author='Unknown', source='plugins/test.py')

this points to the stdlib module test, not our plugin.