Skip to content

Commit

Permalink
0.4.x: Rebuild against JupyterLab 4 and jupyter_server 2 (#1358)
Browse files Browse the repository at this point in the history
* Rebuild against JupyterLab 4

* Migrating to `jupyter-server` 2, `jupyter_client` 7.x (#1308)

* Get changes from #1283

Co-authored-by: Mike <[email protected]>

* Update tree handler

* Add token flag

* Update error template

* Fix types/node version issue

* Update binder build

---------

Co-authored-by: Mike <[email protected]>
(cherry picked from commit e30f6aa)

* Downgrade galata

* Notebook 6 in tests

* Regenerate yarn.lock

* Debug

* Iterate

* Missing test dependency

* Fix dependency install

* Compat with jupyter server 1

* Syntax error

* Add tests for jupyter server 1

* Syntax error

* Flake8

---------

Co-authored-by: Duc Trung Le <[email protected]>
  • Loading branch information
martinRenou and trungleduc committed Jul 28, 2023
1 parent 7445d83 commit dc68959
Show file tree
Hide file tree
Showing 43 changed files with 17,659 additions and 16,686 deletions.
3 changes: 2 additions & 1 deletion .binder/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: voila
channels:
- conda-forge
dependencies:
- jupyterlab=3
- jupyterlab=3.6
- ipywidgets=8
- ipyvolume
- bqplot
Expand All @@ -11,3 +11,4 @@ dependencies:
- ipympl
- xleaflet=0.16.0
- xeus-cling=0.13.0
- python=3.10
39 changes: 20 additions & 19 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
python_version: ['3.7', '3.8', '3.9', '3.10']
python_version: ['3.8', '3.10']
server_version: ['1.18', '2.7.0']

steps:
- uses: actions/checkout@v2
Expand All @@ -32,22 +33,24 @@ jobs:

- name: Create the conda environment
shell: bash -l {0}
run: mamba install -q python=${{ matrix.python_version }} pip jupyterlab_pygments==0.1.0 pytest-cov pytest-rerunfailures nodejs yarn=1 flake8 ipywidgets matplotlib xeus-cling "traitlets>=5.0.3,<6"
run: mamba install -q python=${{ matrix.python_version }} pip jupyterlab_pygments==0.1.0 pytest-cov pytest-rerunfailures nodejs=18 yarn=1 ipywidgets matplotlib xeus-cling "traitlets>=5.0.3,<6" ipykernel jupyter_server=${{ matrix.server_version }}

- name: Install dependencies
shell: bash -l {0}
run: |
whereis python
python --version
yarn install --network-timeout 100000
python -m pip install ".[test]"
python -m pip install ".[test,dev]"
(cd tests/test_template; pip install .)
(cd tests/skip_template; pip install .)
- name: Run tests
shell: bash -l {0}
run: |
VOILA_TEST_XEUS_CLING=1 py.test tests/ --async-test-timeout=240 --reruns 2 --reruns-delay 1
VOILA_TEST_XEUS_CLING=1 py.test tests/app --async-test-timeout=240 --reruns 2 --reruns-delay 1
VOILA_TEST_XEUS_CLING=1 py.test tests/server --async-test-timeout=240 --reruns 2 --reruns-delay 1 --trace
py.test tests/execute_output_test.py
voila --help # Making sure we can run `voila --help`
# tests if voila sends a 'heartbeat' to avoid proxies from closing an apparently stale connection
# Note that wget is the only easily available software that has a read-timeout
Expand All @@ -71,8 +74,8 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [macos-10.15]
python_version: ['3.7', '3.8', '3.9', '3.10']
os: [macos-12]
python_version: ['3.8', '3.9', '3.10']

steps:
- uses: actions/checkout@v2
Expand All @@ -85,28 +88,24 @@ jobs:

- name: Create the conda environment
shell: bash -l {0}
run: mamba install -q python=${{ matrix.python_version }} pip jupyterlab_pygments==0.1.0 pytest-cov pytest-rerunfailures nodejs yarn=1 flake8 ipywidgets matplotlib xeus-cling "traitlets>=5.0.3,<6"
run: mamba install -q python=${{ matrix.python_version }} pip jupyterlab_pygments==0.1.0 pytest-cov pytest-rerunfailures nodejs=18 yarn=1 ipywidgets matplotlib xeus-cling "traitlets>=5.0.3,<6" ipykernel

- name: Install dependencies
shell: bash -l {0}
run: |
whereis python
python --version
yarn install --network-timeout 100000
python -m pip install ".[test]"
python -m pip install ".[test, dev]"
(cd tests/test_template; pip install .)
(cd tests/skip_template; pip install .)
- name: Run tests
shell: bash -l {0}
run: |
py.test tests/ --async-test-timeout=240 --reruns 2 --reruns-delay 1
voila --help # Making sure we can run `voila --help`
# tests if voila sends a 'heartbeat' to avoid proxies from closing an apparently stale connection
# Note that wget is the only easily available software that has a read-timeout
voila tests/notebooks/sleep10seconds.ipynb --port=8878 --VoilaConfiguration.http_keep_alive_timeout=2 &
sleep 2
wget --read-timeout=5 --tries=1 http://localhost:8878
py.test tests/app --async-test-timeout=240 --reruns 2 --reruns-delay 1
py.test tests/server --async-test-timeout=240 --reruns 2 --reruns-delay 1 --trace
py.test tests/execute_output_test.py
test-win:

Expand All @@ -116,7 +115,7 @@ jobs:
fail-fast: false
matrix:
os: [windows-latest]
python-version: ['3.7', '3.8', '3.9', '3.10']
python-version: ['3.8', '3.9', '3.10']
steps:
- uses: actions/checkout@v2

Expand All @@ -127,11 +126,11 @@ jobs:

- uses: actions/setup-node@v2
with:
node-version: '16'
node-version: '18'

- name: Install dependencies
run: |
python -m pip install jupyterlab_pygments==0.1.0 pytest-cov pytest-rereunfailures flake8 ipywidgets matplotlib traitlets
python -m pip install jupyterlab_pygments==0.1.0 pytest-cov pytest-rerunfailures ipywidgets matplotlib traitlets ipykernel
yarn install --network-timeout 100000
python -m pip install ".[test]"
cd tests/test_template
Expand All @@ -142,4 +141,6 @@ jobs:
- name: Run test
run: |
set VOILA_TEST_DEBUG=1
py.test tests/ --async-test-timeout=240 --reruns 2 --reruns-delay 1
py.test tests/app --async-test-timeout=240 --reruns 2 --reruns-delay 1
py.test tests/server --async-test-timeout=240 --reruns 2 --reruns-delay 1 --trace
py.test tests/execute_output_test.py
6 changes: 3 additions & 3 deletions .github/workflows/packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Base Setup
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1

Expand Down Expand Up @@ -58,9 +58,9 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu, macos, windows]
python: ['3.7', '3.10']
python: ['3.8', '3.10']
include:
- python: '3.7'
- python: '3.8'
dist: 'voila*.tar.gz'
- python: '3.10'
dist: 'voila*.whl'
Expand Down
35 changes: 2 additions & 33 deletions .github/workflows/ui-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
jlpm build
jupyter labextension develop . --overwrite
cd ui-tests
jlpm install --frozen-lockfile
jlpm install
- name: Launch Voila
run: |
Expand All @@ -34,7 +34,7 @@ jobs:
working-directory: ui-tests

- name: Install browser
run: jlpm playwright install chromium
run: npx playwright install chromium
working-directory: ui-tests

- name: Wait for Voila
Expand All @@ -47,37 +47,6 @@ jobs:
run: jlpm run test
working-directory: ui-tests

- uses: iterative/setup-cml@v1

- name: Publish Results
env:
REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPORT: ./benchmark-results/voila-benchmark.md
shell: bash
run: |
cd ui-tests
# Publish image to cml.dev
echo "" >> ${REPORT}
cml-publish ./benchmark-results/voila-benchmark.png --md >> ${REPORT}
echo "" >> ${REPORT}
# Test if metadata have changed
export METADATA_DIFF="/tmp/metadata.diff"
diff -u <(jq --sort-keys .metadata benchmark-results/voila-benchmark.json) <(jq --sort-keys .metadata voila-benchmark-expected.json) > ${METADATA_DIFF} || true
if [[ -s ${METADATA_DIFF} ]]; then
echo "<details><summary>:exclamation: Test metadata have changed</summary>" >> ${REPORT}
echo "" >> ${REPORT}
echo "\`\`\`diff" >> ${REPORT}
cat ${METADATA_DIFF} >> ${REPORT}
echo "\`\`\`" >> ${REPORT}
echo "" >> ${REPORT}
echo "</details>" >> ${REPORT}
fi
# Save PR number for comment publication
echo "${{ github.event.number }}" > ./benchmark-results/NR
- name: Upload Playwright Test assets
if: always()
uses: actions/upload-artifact@v2
Expand Down
3 changes: 3 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
enableImmutableInstalls: false

nodeLinker: node-modules
4 changes: 2 additions & 2 deletions hatch_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
from urllib.request import urlopen


JUPYTERLAB_APPUTILS_VERSION = "3.2.8"
JUPYTERLAB_THEME_LIGHT_VERSION = "3.2.8"
JUPYTERLAB_APPUTILS_VERSION = "4.1.2"
JUPYTERLAB_THEME_LIGHT_VERSION = "4.0.2"

CSS_FILES = [
(
Expand Down
3 changes: 1 addition & 2 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"npmClient": "yarn",
"version": "independent",
"useWorkspaces": true
"version": "independent"
}
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@
"build:prod": "lerna run build:prod",
"build:test": "lerna run build:test",
"clean": "lerna run clean",
"eslint": "eslint . --ext .ts,.tsx,.js,.jsx --fix",
"eslint:check": "eslint . --ext .ts,.tsx,.js,.jsx",
"install": "lerna bootstrap",
"eslint": "eslint . --ext .ts,.tsx --fix",
"eslint:check": "eslint . --ext .ts,.tsx",
"prettier": "prettier --write \"**/*{.ts,.tsx,.js,.jsx,.css,.json,.md}\"",
"prettier:check": "prettier --list-different \"**/*{.ts,.tsx,.js,.jsx,.css,.json,.md}\"",
"test": "lerna run test"
Expand Down
29 changes: 14 additions & 15 deletions packages/jupyterlab-preview/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,33 +46,32 @@
"watch:src": "tsc -w"
},
"dependencies": {
"@jupyterlab/application": "^3.0.0",
"@jupyterlab/apputils": "^3.0.0",
"@jupyterlab/coreutils": "^5.0.0",
"@jupyterlab/docregistry": "^3.0.0",
"@jupyterlab/fileeditor": "^3.0.0",
"@jupyterlab/mainmenu": "^3.0.0",
"@jupyterlab/notebook": "^3.0.0",
"@jupyterlab/settingregistry": "^3.0.0",
"@jupyterlab/ui-components": "^3.0.0",
"@lumino/coreutils": "^1.5.3",
"@lumino/signaling": "^1.4.3",
"@jupyterlab/application": "^3 || ^4",
"@jupyterlab/apputils": "^3 || ^4",
"@jupyterlab/coreutils": "^5 || ^6",
"@jupyterlab/docregistry": "^3 || ^4",
"@jupyterlab/fileeditor": "^3 || ^4",
"@jupyterlab/mainmenu": "^3 || ^4",
"@jupyterlab/notebook": "^3 || ^4",
"@jupyterlab/settingregistry": "^3 || ^4",
"@jupyterlab/ui-components": "^3 || ^4",
"@lumino/coreutils": "^1.5.3 || ^2",
"@lumino/signaling": "^1.4.3 || ^2",
"react": "^17.0.1",
"react-dom": "^17.0.1"
},
"devDependencies": {
"@babel/core": "^7.10.2",
"@babel/preset-env": "^7.10.2",
"@jupyterlab/builder": "^3.0.0",
"@jupyterlab/testutils": "^3.0.0",
"@jupyterlab/builder": "^4",
"@types/react": "^17.0.0",
"@types/react-dom": "^17.0.0",
"rimraf": "^2.6.1",
"typescript": "~4.1.3"
"source-map-loader": "~1.0.2",
"typescript": "~5"
},
"jupyterlab": {
"extension": true,
"webpackConfig": "webpack.lab.config.js",
"schemaDir": "schema",
"outputDir": "../../voila/labextension",
"discovery": {
Expand Down
6 changes: 0 additions & 6 deletions packages/jupyterlab-preview/webpack.lab.config.js

This file was deleted.

38 changes: 19 additions & 19 deletions packages/voila/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,25 @@
"main": "lib/index.js",
"browserslist": ">0.8%, not ie 11, not op_mini all, not dead",
"dependencies": {
"@jupyter-widgets/base": "^6.0.1",
"@jupyter-widgets/controls": "^5.0.1",
"@jupyter-widgets/jupyterlab-manager": "^5.0.3",
"@jupyterlab/application": "^3.0.0",
"@jupyterlab/apputils": "^3.0.0",
"@jupyterlab/coreutils": "^5.0.0",
"@jupyterlab/docregistry": "^3.0.0",
"@jupyterlab/javascript-extension": "~3.0.0",
"@jupyterlab/notebook": "^3.0.0",
"@jupyterlab/outputarea": "^3.0.0",
"@jupyterlab/rendermime": "^3.0.0",
"@jupyter-widgets/base": "^6.0.5",
"@jupyter-widgets/controls": "^5.0.6",
"@jupyter-widgets/jupyterlab-manager": "^5.0.8",
"@jupyterlab/application": "^3 || ^4",
"@jupyterlab/apputils": "^3 || ^4",
"@jupyterlab/coreutils": "^5 || ^6",
"@jupyterlab/docregistry": "^3 || ^4 || ^5",
"@jupyterlab/javascript-extension": "^3 || ^4",
"@jupyterlab/notebook": "^3 || ^4",
"@jupyterlab/outputarea": "^3 || ^4",
"@jupyterlab/rendermime": "^3 || ^4",
"@jupyterlab/services": "^6.1.8",
"@lumino/algorithm": "^1.3.3",
"@lumino/commands": "^1.12.0",
"@lumino/domutils": "^1.2.3",
"@lumino/messaging": "^1.4.3",
"@lumino/signaling": "^1.4.3",
"@lumino/virtualdom": "^1.8.0",
"@lumino/widgets": "^1.18.0",
"@lumino/algorithm": "^1.3.3 || ^2",
"@lumino/commands": "^1.12.0 || ^2",
"@lumino/domutils": "^1.2.3 || ^2",
"@lumino/messaging": "^1.4.3 || ^2",
"@lumino/signaling": "^1.4.3 || ^2",
"@lumino/virtualdom": "^1.8.0 || ^2",
"@lumino/widgets": "^1.18.0 || ^2",
"mathjax-full": "^3.0.0"
},
"devDependencies": {
Expand All @@ -40,7 +40,7 @@
"style-loader": "^2.0.0",
"typescript": "~4.1.3",
"url-loader": "^1.0.0",
"webpack": "^4.29.3",
"webpack": "^5",
"webpack-cli": "^3.2.3"
},
"style": "style/index.css",
Expand Down
2 changes: 2 additions & 0 deletions packages/voila/style/index.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import '@jupyter-widgets/controls/css/widgets-base.css';

@font-face /* 0 */ {
font-family: MJXZERO;
src: url('~mathjax-full/es5/output/chtml/fonts/woff-v2/MathJax_Zero.woff')
Expand Down
3 changes: 1 addition & 2 deletions packages/voila/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ module.exports = [
path: distRoot,
libraryTarget: 'amd'
},
module: { rules: rules },
devtool: 'source-map'
module: { rules: rules }
}
];
Loading

0 comments on commit dc68959

Please sign in to comment.