Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jnumainville committed Mar 4, 2024
1 parent 1639b79 commit 56fd0e6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
16 changes: 11 additions & 5 deletions .github/workflows/release-python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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__)

Expand Down Expand Up @@ -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."
)
Expand Down
5 changes: 3 additions & 2 deletions plugins/utilities/src/deephaven/plugin/utilities/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down

0 comments on commit 56fd0e6

Please sign in to comment.