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

Include developer instructions for installing in editable mode #93

Open
mofojed opened this issue Oct 18, 2023 · 3 comments
Open

Include developer instructions for installing in editable mode #93

mofojed opened this issue Oct 18, 2023 · 3 comments
Labels
enhancement New feature or request
Milestone

Comments

@mofojed
Copy link
Member

mofojed commented Oct 18, 2023

As a developer, I want to be able to install these python modules in editable mode so I can make change without build and reinstall a wheel every time. https://pip.pypa.io/en/stable/topics/local-project-installs/#editable-installs

@mofojed mofojed added the enhancement New feature or request label Oct 18, 2023
@mofojed
Copy link
Member Author

mofojed commented Oct 18, 2023

I currently can't get Python editable mode to work with deephaven.ui or plotly-express. I'm wondering if we're using namespace packages incorrectly and that may be the reason why? https://peps.python.org/pep-0420/#specification

I tried installing the package in editable, like:

pip install -e  ~/dev/deephaven/iris-oss/deephaven-plugins/plugins/ui

And they show up in the pip list correctly:

(.venv) ➜  main git:(main) pip list | grep deep                                                 
deephaven-core                  0.29.0
deephaven-plugin                0.5.0
deephaven-plugin-matplotlib     0.3.0.dev0
deephaven-plugin-plotly-express 0.0.7.dev0   /home/bender/dev/deephaven/iris-oss/deephaven-plugins/plugins/plotly-express
deephaven-plugin-ui             0.0.1.dev1   /home/bender/dev/deephaven/iris-oss/deephaven-plugins/plugins/ui
deephaven-server                0.29.0

But then starting up the server I get a ModuleNotFoundError on plugin registration:

2023-10-18T17:33:32.850Z | main                 |  INFO | .d.s.p.PluginRegistration | Invoking registration: io.deephaven.server.plugin.python.PythonPluginsRegistration@2acbc859
Initiating shutdown due to: Uncaught exception in thread main
java.lang.RuntimeException: Error in Python interpreter:
Type: <class 'ModuleNotFoundError'>
Value: No module named 'deephaven.ui'
Line: 1004
Namespace: _find_and_load_unlocked
File: <frozen importlib._bootstrap>
Traceback (most recent call last):
  File "/home/bender/dev/deephaven/iris-oss/core/main/.venv/lib/python3.10/site-packages/deephaven_internal/plugin/__init__.py", line 18, in initialize_all_and_register_into
  File "/home/bender/dev/deephaven/iris-oss/core/main/.venv/lib/python3.10/site-packages/deephaven_internal/plugin/register.py", line 18, in initialize_all_and_register_into
  File "/home/bender/dev/deephaven/iris-oss/core/main/.venv/lib/python3.10/site-packages/deephaven/plugin/__init__.py", line 94, in register_all_into
  File "/home/bender/dev/deephaven/iris-oss/core/main/.venv/lib/python3.10/site-packages/deephaven/plugin/__init__.py", line 90, in collect_registration_classes
  File "/home/bender/dev/deephaven/iris-oss/core/main/.venv/lib/python3.10/site-packages/deephaven/plugin/__init__.py", line 90, in <listcomp>
  File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 171, in load
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked

@mattrunyon
Copy link
Collaborator

It's because of namespaces. I ran into issues when trying to use deephaven-plugin in editable mode with core

@devinrsmith
Copy link
Member

Editable mode may also be tricky if we want to package js plugins in python environments. It may be a better tack to take to configure the deephaven server to point to the NPM packages (deephaven.jsPlugins.<name>=/path/to/package_root) as opposed to trying to plumb in through a Plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants