diff --git a/.github/workflows/release-python-package.yml b/.github/workflows/release-python-package.yml index 2e9a51ec9..8b8171b15 100644 --- a/.github/workflows/release-python-package.yml +++ b/.github/workflows/release-python-package.yml @@ -28,13 +28,19 @@ jobs: node-version: '18.x' registry-url: 'https://registry.npmjs.org' + - name: Check file existence + id: check_files + uses: andstor/file-existence-action@v3 + with: + files: "plugins/${{ inputs.package }}/src/deephaven/js/package.json" + - name: Install npm dependencies - run: npm ci - + if: steps.check_files.outputs.files_exists == 'true' + run: npm install + - name: Build npm packages - # utilities and packaging packages do not have npm packages to build - if : ${{ inputs.package != 'utilities' && inputs.package != 'packaging' }} - run: npm run build -- --scope "@deephaven/js-plugin-${{ inputs.package }}" + if: steps.check_files.outputs.files_exists == 'true' + run: npm run build - name: Set up Python uses: actions/setup-python@v4 diff --git a/plugins/utilities/src/deephaven/plugin/utilities/dhe_safe_callback_wrapper.py b/plugins/utilities/src/deephaven/plugin/utilities/dhe_safe_callback_wrapper.py index 3754e2aaa..f9fb94a26 100644 --- a/plugins/utilities/src/deephaven/plugin/utilities/dhe_safe_callback_wrapper.py +++ b/plugins/utilities/src/deephaven/plugin/utilities/dhe_safe_callback_wrapper.py @@ -4,7 +4,7 @@ import logging from deephaven.plugin import Callback, Plugin from deephaven.plugin.js import JsPlugin -from .utils import in_enterprise_environment +from .utils import is_enterprise_environment logger = logging.getLogger(__name__) @@ -47,7 +47,7 @@ def _register_js(self, js_plugin: JsPlugin) -> None: try: self._callback.register(js_plugin) except RuntimeError as e: - if in_enterprise_environment(): + if is_enterprise_environment(): logger.debug( f"Failed to register {js_plugin} embedded in Python plugin. Skipping." ) diff --git a/plugins/utilities/src/deephaven/plugin/utilities/utils.py b/plugins/utilities/src/deephaven/plugin/utilities/utils.py index 7afce6990..62bbe0a0f 100644 --- a/plugins/utilities/src/deephaven/plugin/utilities/utils.py +++ b/plugins/utilities/src/deephaven/plugin/utilities/utils.py @@ -10,16 +10,17 @@ logger = logging.getLogger(__name__) -__all__ = ["in_enterprise_environment", "create_js_plugin"] +__all__ = ["is_enterprise_environment", "create_js_plugin"] -def in_enterprise_environment() -> bool: +def is_enterprise_environment() -> bool: """ Check if the environment is an enterprise environment. Returns: True if the environment is an enterprise environment, False otherwise """ + # TODO: better implementation after https://deephaven.atlassian.net/browse/DH-16573 return any("coreplus" in path or "dnd" in path for path in sys.path)