deephaven / deephaven-plugins

Deephaven Plugins
7 stars 14 forks source link

Emulate editable installs in plugin_builder.py #632

Closed jnumainville closed 8 hours ago

jnumainville commented 1 month ago

https://github.com/deephaven/deephaven-plugins/pull/630 adds a new script, plugin_builder.py, that makes plugin development easier. Currently, the script can run a server, but it would be nice if the script could watch for changes within plugin folders then rebuild and restart the server automatically. One possibility, perhaps crude, is to use watchdog

mattrunyon commented 1 month ago

You can also use nodemon since Node is required to use the plugins repo

This watch files with a py extension (-e py) in plugins/ui/src. When any of them changes, it runs python -m build --wheel plugins/ui

npx nodemon --exec "python -m build --wheel plugins/ui" --watch plugins/ui/src -e py

This watches for whl file changes in the ui dist folder and reinstalls + restarts the server (w/ gradle).

npx nodemon --exec "pip install --force --no-deps ../deephaven-plugins/plugins/ui/dist/*.whl && ./server/jetty-app/build/install/server-jetty/bin/start" --watch ../deephaven-plugins/plugins/ui/dist -e whl

npx just lets you run an npm package command. nodemon is a command in this case.