diff --git a/plugins/pivot/README.md b/plugins/pivot/README.md index 457143de7..9d7eec46f 100644 --- a/plugins/pivot/README.md +++ b/plugins/pivot/README.md @@ -4,24 +4,16 @@ This plugin adds UI support for Pivot tables in Core+ workers in Enterprise. ## Plugin Structure -`src/deephaven/pivot/register.py` registers the plugin with Deephaven. This file will not need to be modified for most plugins at the initial stages, but will need to be if the package is renamed or JavaScript files are moved. - -The JavaScript files have the following structure: -`PivotPlugin.ts` registers the plugin with Deephaven. This contains the client equivalent of the type in `pivot_type.py` and these should be kept in sync. -`PivotWidget.tsx` defines the plugin panel and message handling. This is where messages are received when sent from the Python side of the plugin. This file is a good starting point for adding more complex plugin functionality. - -Additionally, the `test` directory contains Python tests for the plugin. This demonstrates how the embedded Deephaven server can be used in tests. -It's recommended to use `tox` to run the tests, and the `tox.ini` file is included in the project. +`PivotPlugin.ts` registers the plugin with Deephaven. +`PivotWidget.tsx` defines the plugin panel and widget handling. ## Building the Plugin -Use the [`plugin_builder.py`](../../README.md#using-plugin_builderpy) from the root directory. +Run `npm run build` from the root directory. ## Installation -1. Add `deephaven-plugin-pivot` to Core+ dependencies in `requirements.txt` - -2. Add `@deephaven/js-plugin-pivot` js package to `pluginList` in `DhcInDhe/gradle.build` +Add `@deephaven/js-plugin-pivot` js package to `pluginList` in `DhcInDhe/gradle.build` ## Using the Plugin diff --git a/plugins/pivot/pyproject.toml b/plugins/pivot/pyproject.toml deleted file mode 100644 index 54e217464..000000000 --- a/plugins/pivot/pyproject.toml +++ /dev/null @@ -1,3 +0,0 @@ -[build-system] -requires = ["setuptools>=43.0.0", "wheel", "deephaven-plugin-packaging"] -build-backend = "setuptools.build_meta" diff --git a/plugins/pivot/requirements.txt b/plugins/pivot/requirements.txt deleted file mode 100644 index c901c3334..000000000 --- a/plugins/pivot/requirements.txt +++ /dev/null @@ -1,5 +0,0 @@ -build -pip -pre-commit -setuptools -tox \ No newline at end of file diff --git a/plugins/pivot/setup.cfg b/plugins/pivot/setup.cfg deleted file mode 100644 index 7df0ec0d7..000000000 --- a/plugins/pivot/setup.cfg +++ /dev/null @@ -1,27 +0,0 @@ -[metadata] -name = deephaven-plugin-pivot -description = Deephaven Pivot Plugin -long_description = file: README.md -long_description_content_type = text/markdown -version = 0.0.1.dev8 -keywords = deephaven, plugin, graph -author = Deephaven -author_email = vladbabich@deephaven.io -platforms = any - -[options] -package_dir= - =src -packages=find_namespace: -install_requires = - deephaven-core>=0.35.1 - deephaven-plugin>=0.6.0 - deephaven-plugin-utilities -include_package_data = True - -[options.packages.find] -where=src - -[options.entry_points] -deephaven.plugin = - registration_cls = deephaven.pivot.register:PivotRegistration diff --git a/plugins/pivot/setup.py b/plugins/pivot/setup.py deleted file mode 100644 index 5358323ed..000000000 --- a/plugins/pivot/setup.py +++ /dev/null @@ -1,12 +0,0 @@ -from setuptools import setup -import os -from deephaven.plugin.packaging import package_js - -# js_dir is the directory where the JavaScript source files are located -js_dir = "src/js/" -# dest_dir is the directory where the JavaScript source files will be copied to in the package -dest_dir = os.path.join("src/deephaven/pivot/_js") - -package_js(js_dir, dest_dir) - -setup(package_data={"deephaven.pivot._js": ["**"]}) diff --git a/plugins/pivot/src/deephaven/pivot/.gitignore b/plugins/pivot/src/deephaven/pivot/.gitignore deleted file mode 100644 index 1b9252d0d..000000000 --- a/plugins/pivot/src/deephaven/pivot/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# This is where built js files are stored by setup.py -_js/ \ No newline at end of file diff --git a/plugins/pivot/src/deephaven/pivot/__init__.py b/plugins/pivot/src/deephaven/pivot/__init__.py deleted file mode 100644 index 57ebdd60c..000000000 --- a/plugins/pivot/src/deephaven/pivot/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -""" -This plugin does not require initialization. -""" diff --git a/plugins/pivot/src/deephaven/pivot/register.py b/plugins/pivot/src/deephaven/pivot/register.py deleted file mode 100644 index c7ccb3555..000000000 --- a/plugins/pivot/src/deephaven/pivot/register.py +++ /dev/null @@ -1,18 +0,0 @@ -from deephaven.plugin import Registration, Callback -from deephaven.plugin.utilities import create_js_plugin, DheSafeCallbackWrapper - -# The namespace that the Python plugin will be registered under. -PACKAGE_NAMESPACE = "deephaven.pivot" -# Where the Javascript plugin is. This is set in setup.py. -JS_NAME = "_js" - - -class PivotRegistration(Registration): - @classmethod - def register_into(cls, callback: Callback) -> None: - callback = DheSafeCallbackWrapper(callback) - - # The JavaScript plugin requires a special registration process, which is handled here - js_plugin = create_js_plugin(PACKAGE_NAMESPACE, JS_NAME) - - callback.register(js_plugin) diff --git a/plugins/pivot/src/js/package.json b/plugins/pivot/src/js/package.json index 26ea2ac24..504ea6fa4 100644 --- a/plugins/pivot/src/js/package.json +++ b/plugins/pivot/src/js/package.json @@ -1,6 +1,6 @@ { "name": "@deephaven/js-plugin-pivot", - "version": "0.0.3-dev.983+f7d1ce54", + "version": "0.0.4", "description": "Pivot plugin for Deephaven", "keywords": [ "Deephaven", diff --git a/plugins/pivot/test/__init__.py b/plugins/pivot/test/__init__.py deleted file mode 100644 index 8718e3915..000000000 --- a/plugins/pivot/test/__init__.py +++ /dev/null @@ -1,10 +0,0 @@ -from deephaven_server.server import Server - -# Create a Server instance to initialize the JVM -# Otherwise we get errors whenever we try to import anything or run tests -# We don't even need to start the server, just create an instance. -# https://github.com/deephaven/deephaven-core/blob/b5cae98c2f11b032cdd1b9c248dc5b4a0f95314a/py/embedded-server/deephaven_server/server.py#L152 -# Whenever you import anything from the deephaven namespace, it will check if the JVM is ready: -# https://github.com/deephaven/deephaven-core/blob/b5cae98c2f11b032cdd1b9c248dc5b4a0f95314a/py/server/deephaven/__init__.py#L15 -if Server.instance is None: - Server(port=11000, jvm_args=["-Xmx4g"]) diff --git a/plugins/pivot/test/pivot/BaseTest.py b/plugins/pivot/test/pivot/BaseTest.py deleted file mode 100644 index ee85249b3..000000000 --- a/plugins/pivot/test/pivot/BaseTest.py +++ /dev/null @@ -1,24 +0,0 @@ -import unittest -from unittest.mock import patch - -from deephaven_server import Server - - -class BaseTestCase(unittest.TestCase): - @classmethod - def setUpClass(cls): - cls.setup_exporter_mock() - - @classmethod - @patch("deephaven.plugin.object_type.Exporter") - @patch("deephaven.plugin.object_type.Reference") - def setup_exporter_mock(cls, MockExporter, MockReference): - cls.exporter = MockExporter() - cls.reference = MockReference() - - cls.reference.index = 0 - cls.exporter.reference.return_value = MockReference() - - -if __name__ == "__main__": - unittest.main() diff --git a/plugins/pivot/test/pivot/__init__.py b/plugins/pivot/test/pivot/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/plugins/pivot/test/pivot/test.py b/plugins/pivot/test/pivot/test.py deleted file mode 100644 index f79744d33..000000000 --- a/plugins/pivot/test/pivot/test.py +++ /dev/null @@ -1,14 +0,0 @@ -import unittest -from .BaseTest import BaseTestCase - - -class Test(BaseTestCase): - def test(self): - # since the tests use the embedded server, the import must happen after the tests start - from deephaven.table import Table - - pass - - -if __name__ == "__main__": - unittest.main() diff --git a/plugins/pivot/tox.ini b/plugins/pivot/tox.ini deleted file mode 100644 index bdebb2457..000000000 --- a/plugins/pivot/tox.ini +++ /dev/null @@ -1,24 +0,0 @@ -[tox] -isolated_build = True - -[testenv] -deps = - deephaven-server -commands = - python -m unittest {posargs} -basepython = python3.8 - -[testenv:py3.8] -basepython = python3.8 - -[testenv:py3.9] -basepython = python3.9 - -[testenv:py3.10] -basepython = python3.10 - -[testenv:py3.11] -basepython = python3.11 - -[testenv:py3.12] -basepython = python3.12 \ No newline at end of file