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

Calling plugin_layout fails if your plugin is not an installed package #603

Open
oysteinequinor opened this issue Jul 6, 2022 · 1 comment

Comments

@oysteinequinor
Copy link

Describe the bug
Subclassing the WebvizPluginABC and calling plugin_layout crashes unless the plugin you are writing is installed as a package in your python environment.

How to reproduce

import webviz_config
class MyPlugin(webviz_config.WebvizPluginABC):
    def layout(self):
        return ""
MyPlugin().plugin_layout()

... webviz-config/webviz_config/_plugin_abc.py", line 185, in _make_extended_deprecation_warnings
dist_name = PLUGIN_METADATA[plugin_name]["dist_name"]
KeyError: 'MyPlugin'

Expected behavior
I expect plugin_layout to return the layout.

Additional context
We are using our webviz plugin by importing it (without installing it) and adding it to a dash app manually.

Suggested fix
I think iterating through installed packages in _make_extended_deprecation_warnings is a bit shady. Maybe find another way of doing something similar. A minimal fix is to silently skip if it fails?

@anders-kiaer
Copy link
Collaborator

I agree with this - thanks for the report @oysteinequinor. 👍

@anders-kiaer anders-kiaer moved this to Backlog 📝 in Webviz Jan 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog 📝
Development

No branches or pull requests

2 participants