Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into 668_hist
Browse files Browse the repository at this point in the history
  • Loading branch information
jnumainville committed Jan 13, 2025
2 parents 857a488 + 49ad632 commit 0039c78
Show file tree
Hide file tree
Showing 270 changed files with 137,057 additions and 5,287 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,6 @@ test-results/
playwright-report/
blob-report/
playwright/.cache/

# Ignore docs
**/*.md
4 changes: 2 additions & 2 deletions .github/workflows/build-python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
run: npm run build -- --scope "@deephaven/js-plugin-${{ inputs.package }}"

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.x'

Expand All @@ -47,7 +47,7 @@ jobs:
run: python -m build --wheel --sdist plugins/${{ inputs.package }}

- name: Upload dist
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: dist-${{ inputs.package }}
path: plugins/${{ inputs.package }}/dist/
Expand Down
31 changes: 9 additions & 22 deletions .github/workflows/make-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:

# assume that the dist artifact is already available from calling build-python-package.yml before this workflow
- name: Download dist
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: dist-${{ inputs.package }}
path: plugins/${{ inputs.package }}/dist/
Expand All @@ -41,29 +41,16 @@ jobs:
- name: Run make_docs.py
run: python plugins/${{ inputs.package }}/make_docs.py

- name: Setup rclone
- name: Sync to the plugins folder
# pull requests should run the make_docs.py script, but not sync the docs
if: inputs.event_name == 'push'
run: |
sudo apt-get update
sudo apt-get install -y rclone
mkdir -p $HOME/.config
mkdir -p $HOME/.config/rclone
cat << EOF > $HOME/.config/rclone/rclone.conf
[plugindocs]
type = google cloud storage
service_account_file = $HOME/credentials.json
project_number = ${{ secrets.DOCS_GOOGLE_CLOUD_PROJECT_NUMBER }}
bucket_policy_only = true
EOF
echo ${{ secrets.DOCS_GOOGLE_CLOUD_CREDENTIALS }} | base64 -d > $HOME/credentials.json
- name: Sync docs
if: inputs.event_name == 'push'
run: rclone sync plugins/${{ inputs.package }}/docs/build/markdown/ plugindocs:${{ secrets.DOCS_GOOGLE_CLOUD_BUCKET }}/deephaven/deephaven-plugins/${{ inputs.package }}/${{ inputs.version }}/
uses: deephaven/salmon-sync@v1
with:
source: plugins/${{ inputs.package }}/docs/build/markdown/
destination: deephaven/deephaven-plugins/${{ inputs.package }}/${{ inputs.version }}/
project_number: ${{ secrets.DOCS_GOOGLE_CLOUD_PROJECT_NUMBER}}
bucket: ${{ vars.DOCS_GOOGLE_CLOUD_BUCKET }}
credentials: ${{ secrets.DOCS_GOOGLE_CLOUD_CREDENTIALS }}

- name: Setup gsutil auth
if: inputs.fix_mime_types == true
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/modified-plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Filter paths
uses: dorny/paths-filter@v2
uses: dorny/paths-filter@v3
id: filter
with:
filters: |
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Pre-commit for Black and Blacken-docs
name: Pre-commit for code style and formatting checks

on:
push:
Expand All @@ -17,5 +17,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v3
- uses: pre-commit/[email protected]
- uses: actions/setup-python@v5
with:
python-version: '3.8'
- uses: pre-commit/[email protected]
3 changes: 2 additions & 1 deletion .github/workflows/release-python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
uses: actions/checkout@v4

- name: Download dist
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: dist-${{ inputs.package }}
path: plugins/${{ inputs.package }}/dist/
Expand All @@ -56,6 +56,7 @@ jobs:
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: plugins/${{ inputs.package }}/dist/
attestations: false # TODO: Followup this thread to see if there's a better fix https://github.com/pypa/gh-action-pypi-publish/issues/283

check-make-docs:
runs-on: ubuntu-22.04
Expand Down
19 changes: 14 additions & 5 deletions .github/workflows/test-js-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,31 @@ jobs:
restore-keys: |
${{ runner.os }}-lintcache-
- name: Cache node modules
id: cache-node-modules
uses: actions/cache@v4
- name: Restore cached node modules
id: restore-node-modules
uses: actions/cache/restore@v4
with:
save-always: true
path: |
node_modules
plugins/**/node_modules
key: unit-node-modules-${{ hashFiles('package-lock.json')}}

- name: Install dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
if: steps.restore-node-modules.outputs.cache-hit != 'true'
run: npm ci --no-audit

# Run all tests for all the packages
# Caching with the absolute path b/c Jest will make a folder in each project
# Then there's caches in all plugin folders
- name: Run Tests
run: npm run test:ci

- name: Always cache node modules
id: cache-node-modules
if: always() && steps.restore-node-modules.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
key: ${{ steps.restore-node-modules.outputs.cache-primary-key }}
path: |
node_modules
plugins/**/node_modules
4 changes: 2 additions & 2 deletions .github/workflows/test-python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}

Expand All @@ -27,5 +27,5 @@ jobs:
working-directory: 'plugins/${{ inputs.package }}'

- name: Run tox
run: tox -e py
run: tox -e py${{ matrix.python }}
working-directory: 'plugins/${{ inputs.package }}'
27 changes: 27 additions & 0 deletions .github/workflows/typescript-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Check TypeScript types

on:
push:
branches:
- main
- 'release/**'
- 'feature/**'
pull_request:
branches:
- main
- 'release/**'
- 'feature/**'

jobs:
typescript-check:
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: npm ci
- name: Check TypeScript types
run: python tools/check_typescript_ci.py

22 changes: 19 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,30 @@ You should be able to pass arguments to these commands as if you were running Pl
It is highly recommended to use `npm run e2e:docker` (instead of `npm run e2e`) as CI also uses the same environment. You can also use `npm run e2e:update-snapshots` to regenerate snapshots in said environment. Run Playwright in [UI Mode](https://playwright.dev/docs/test-ui-mode) with `npm run e2e:ui` when creating new tests or debugging, as this will allow you to run each test individually, see the browser as it runs it, inspect the console, evaluate locators, etc.

### Running Python tests

The above steps will also set up `tox` to run tests for the python plugins that support it.
The [venv setup](#pre-commit-hookspython-formatting) steps will also set up `tox` to run tests for the python plugins that support it.
Note that `tox` sets up an isolated environment for running tests.
Be default, `tox` will run against Python 3.8, which will need to be installed on your system before running tests.
You can run tests with the following command from the `plugins/<plugin>` directory:

```shell
tox -e py
```

> [!IMPORTANT]
> Linux, and possibly other setups such as MacOS depending on method, may require additional packages to be installed to run Python 3.8.
> ```shell
> sudo apt install python3.8 python3.8-distutils libpython3.8
> # or just full install although it will include more packages than necessary
> sudo apt install python3.8-full
> ```

You can also run tests against a specific version of python by appending the version to `py`
This assumes that the version of Python you're targeting is installed on your system.
For example, to run tests against Python 3.12, run:
```shell
tox -e py3.12
```
### Running plugin against deephaven-core
#### Building Python plugins for development
Expand Down
40 changes: 39 additions & 1 deletion jest.config.base.cjs
Original file line number Diff line number Diff line change
@@ -1,11 +1,49 @@
const path = require('path');

// List of node_modules that need to be transformed from ESM to CJS for jest to work
const nodeModulesToTransform = [
'@deephaven',
'nanoid',
// monaco
'monaco-editor',
// plotly.js dependencies
'd3-interpolate',
'd3-color',
// react-markdown and its dependencies
'react-markdown',
'vfile',
'vfile-message',
'unist-util.*',
'unified',
'bail',
'is-plain-obj',
'trough',
'remark.*',
'mdast-util.*',
'micromark.*',
'decode-named-character-reference',
'trim-lines',
'property-information',
'hast-util.*',
'.*separated-tokens',
'ccount',
'devlop',
'escape-string-regexp',
'markdown-table',
'zwitch',
'longest-streak',
'rehype.*',
'web-namespaces',
'hastscript',
'@astral-sh/ruff-wasm-web',
];

module.exports = {
transform: {
'^.+\\.(ts|tsx|js|jsx)$': ['babel-jest', { rootMode: 'upward' }],
},
transformIgnorePatterns: [
'/node_modules/(?!(@deephaven|monaco-editor|d3-interpolate|d3-color|nanoid)/)',
`node_modules/(?!(${nodeModulesToTransform.join('|')})/)`,
],
moduleNameMapper: {
'theme-([^/]+?)\\.css(\\?(?:inline|raw))?$': path.join(
Expand Down
Loading

0 comments on commit 0039c78

Please sign in to comment.