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

fix: Fix widget plugin python warnings #740

Merged
merged 4 commits into from
Sep 5, 2024

Conversation

jnumainville
Copy link
Collaborator

@jnumainville jnumainville commented Aug 15, 2024

Fixes #713
Mostly minor warnings fixed
The main fix of consequence is a new class, CommonJsPlugin, in utilities. This should be inherited from by all plugins that use JsPlugin because create_js_plugin actually requires something of the form CommonJsPlugin as JsPlugin doesn't specify the inputs it takes. I made CommonJsPlugin the default but a JsPlugin can still be passed so that this doesn't break existing plugins. We should do this first and release a new utilities package. I will make a follow-up PR that will fix the inheritance on all our packages to ensure the typing is correct.

@@ -13,6 +13,35 @@
__all__ = ["is_enterprise_environment", "create_js_plugin"]


class CommonJsPlugin(JsPlugin):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the point of having all the individual plugin classes (UiJsPlugin, ExpressJsPlugin, MatplotlibJsPlugin)? They all do the exact same thing.

We should just get rid of the plugin_class parameter entirely (deprecate first, release, then remove), and then it can just create a CommonJsPlugin in there.

Or is there another reason to be able to specify a custom class?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No reason that I know of.
I've got #741 up to remove them from the plugins

@jnumainville jnumainville self-assigned this Aug 23, 2024
mofojed
mofojed previously approved these changes Sep 4, 2024
@jnumainville jnumainville merged commit 920b65f into deephaven:main Sep 5, 2024
16 checks passed
jnumainville added a commit that referenced this pull request Sep 6, 2024
Fixes #714 

Adds a new script that is essentially a (slightly) lighter version of
`tools/plugin_builder.py` to the widget template.

Tested with commands in readme

Somehow an earlier version snuck into #740 on accident, hence it being
"modified" instead of new
mofojed added a commit that referenced this pull request Sep 19, 2024
Followup for #740 

Modifies our plugins to use `CommonJsPlugin` by dropping the arg (since
it's made optional in #740) and using the default.

---------

Co-authored-by: mikebender <[email protected]>
wusteven815 pushed a commit to wusteven815/deephaven-plugins that referenced this pull request Sep 24, 2024
Followup for deephaven#740 

Modifies our plugins to use `CommonJsPlugin` by dropping the arg (since
it's made optional in deephaven#740) and using the default.

---------

Co-authored-by: mikebender <[email protected]>
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.

Clean up widget template errors
2 participants