Skip to content

Commit dc68959

Browse files
0.4.x: Rebuild against JupyterLab 4 and jupyter_server 2 (#1358)
* 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]>
1 parent 7445d83 commit dc68959

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+17659
-16686
lines changed

.binder/environment.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: voila
22
channels:
33
- conda-forge
44
dependencies:
5-
- jupyterlab=3
5+
- jupyterlab=3.6
66
- ipywidgets=8
77
- ipyvolume
88
- bqplot
@@ -11,3 +11,4 @@ dependencies:
1111
- ipympl
1212
- xleaflet=0.16.0
1313
- xeus-cling=0.13.0
14+
- python=3.10

.github/workflows/main.yml

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ jobs:
1919
fail-fast: false
2020
matrix:
2121
os: [ubuntu-latest]
22-
python_version: ['3.7', '3.8', '3.9', '3.10']
22+
python_version: ['3.8', '3.10']
23+
server_version: ['1.18', '2.7.0']
2324

2425
steps:
2526
- uses: actions/checkout@v2
@@ -32,22 +33,24 @@ jobs:
3233

3334
- name: Create the conda environment
3435
shell: bash -l {0}
35-
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"
36+
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 }}
3637

3738
- name: Install dependencies
3839
shell: bash -l {0}
3940
run: |
4041
whereis python
4142
python --version
4243
yarn install --network-timeout 100000
43-
python -m pip install ".[test]"
44+
python -m pip install ".[test,dev]"
4445
(cd tests/test_template; pip install .)
4546
(cd tests/skip_template; pip install .)
4647
4748
- name: Run tests
4849
shell: bash -l {0}
4950
run: |
50-
VOILA_TEST_XEUS_CLING=1 py.test tests/ --async-test-timeout=240 --reruns 2 --reruns-delay 1
51+
VOILA_TEST_XEUS_CLING=1 py.test tests/app --async-test-timeout=240 --reruns 2 --reruns-delay 1
52+
VOILA_TEST_XEUS_CLING=1 py.test tests/server --async-test-timeout=240 --reruns 2 --reruns-delay 1 --trace
53+
py.test tests/execute_output_test.py
5154
voila --help # Making sure we can run `voila --help`
5255
# tests if voila sends a 'heartbeat' to avoid proxies from closing an apparently stale connection
5356
# Note that wget is the only easily available software that has a read-timeout
@@ -71,8 +74,8 @@ jobs:
7174
strategy:
7275
fail-fast: false
7376
matrix:
74-
os: [macos-10.15]
75-
python_version: ['3.7', '3.8', '3.9', '3.10']
77+
os: [macos-12]
78+
python_version: ['3.8', '3.9', '3.10']
7679

7780
steps:
7881
- uses: actions/checkout@v2
@@ -85,28 +88,24 @@ jobs:
8588

8689
- name: Create the conda environment
8790
shell: bash -l {0}
88-
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"
91+
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
8992

9093
- name: Install dependencies
9194
shell: bash -l {0}
9295
run: |
9396
whereis python
9497
python --version
9598
yarn install --network-timeout 100000
96-
python -m pip install ".[test]"
99+
python -m pip install ".[test, dev]"
97100
(cd tests/test_template; pip install .)
98101
(cd tests/skip_template; pip install .)
99102
100103
- name: Run tests
101104
shell: bash -l {0}
102105
run: |
103-
py.test tests/ --async-test-timeout=240 --reruns 2 --reruns-delay 1
104-
voila --help # Making sure we can run `voila --help`
105-
# tests if voila sends a 'heartbeat' to avoid proxies from closing an apparently stale connection
106-
# Note that wget is the only easily available software that has a read-timeout
107-
voila tests/notebooks/sleep10seconds.ipynb --port=8878 --VoilaConfiguration.http_keep_alive_timeout=2 &
108-
sleep 2
109-
wget --read-timeout=5 --tries=1 http://localhost:8878
106+
py.test tests/app --async-test-timeout=240 --reruns 2 --reruns-delay 1
107+
py.test tests/server --async-test-timeout=240 --reruns 2 --reruns-delay 1 --trace
108+
py.test tests/execute_output_test.py
110109
111110
test-win:
112111

@@ -116,7 +115,7 @@ jobs:
116115
fail-fast: false
117116
matrix:
118117
os: [windows-latest]
119-
python-version: ['3.7', '3.8', '3.9', '3.10']
118+
python-version: ['3.8', '3.9', '3.10']
120119
steps:
121120
- uses: actions/checkout@v2
122121

@@ -127,11 +126,11 @@ jobs:
127126

128127
- uses: actions/setup-node@v2
129128
with:
130-
node-version: '16'
129+
node-version: '18'
131130

132131
- name: Install dependencies
133132
run: |
134-
python -m pip install jupyterlab_pygments==0.1.0 pytest-cov pytest-rereunfailures flake8 ipywidgets matplotlib traitlets
133+
python -m pip install jupyterlab_pygments==0.1.0 pytest-cov pytest-rerunfailures ipywidgets matplotlib traitlets ipykernel
135134
yarn install --network-timeout 100000
136135
python -m pip install ".[test]"
137136
cd tests/test_template
@@ -142,4 +141,6 @@ jobs:
142141
- name: Run test
143142
run: |
144143
set VOILA_TEST_DEBUG=1
145-
py.test tests/ --async-test-timeout=240 --reruns 2 --reruns-delay 1
144+
py.test tests/app --async-test-timeout=240 --reruns 2 --reruns-delay 1
145+
py.test tests/server --async-test-timeout=240 --reruns 2 --reruns-delay 1 --trace
146+
py.test tests/execute_output_test.py

.github/workflows/packaging.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
steps:
2222
- name: Checkout
2323
uses: actions/checkout@v2
24-
24+
2525
- name: Base Setup
2626
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
2727

@@ -58,9 +58,9 @@ jobs:
5858
fail-fast: false
5959
matrix:
6060
os: [ubuntu, macos, windows]
61-
python: ['3.7', '3.10']
61+
python: ['3.8', '3.10']
6262
include:
63-
- python: '3.7'
63+
- python: '3.8'
6464
dist: 'voila*.tar.gz'
6565
- python: '3.10'
6666
dist: 'voila*.whl'

.github/workflows/ui-tests.yml

Lines changed: 2 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
jlpm build
2626
jupyter labextension develop . --overwrite
2727
cd ui-tests
28-
jlpm install --frozen-lockfile
28+
jlpm install
2929
3030
- name: Launch Voila
3131
run: |
@@ -34,7 +34,7 @@ jobs:
3434
working-directory: ui-tests
3535

3636
- name: Install browser
37-
run: jlpm playwright install chromium
37+
run: npx playwright install chromium
3838
working-directory: ui-tests
3939

4040
- name: Wait for Voila
@@ -47,37 +47,6 @@ jobs:
4747
run: jlpm run test
4848
working-directory: ui-tests
4949

50-
- uses: iterative/setup-cml@v1
51-
52-
- name: Publish Results
53-
env:
54-
REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55-
REPORT: ./benchmark-results/voila-benchmark.md
56-
shell: bash
57-
run: |
58-
cd ui-tests
59-
60-
# Publish image to cml.dev
61-
echo "" >> ${REPORT}
62-
cml-publish ./benchmark-results/voila-benchmark.png --md >> ${REPORT}
63-
echo "" >> ${REPORT}
64-
65-
# Test if metadata have changed
66-
export METADATA_DIFF="/tmp/metadata.diff"
67-
diff -u <(jq --sort-keys .metadata benchmark-results/voila-benchmark.json) <(jq --sort-keys .metadata voila-benchmark-expected.json) > ${METADATA_DIFF} || true
68-
if [[ -s ${METADATA_DIFF} ]]; then
69-
echo "<details><summary>:exclamation: Test metadata have changed</summary>" >> ${REPORT}
70-
echo "" >> ${REPORT}
71-
echo "\`\`\`diff" >> ${REPORT}
72-
cat ${METADATA_DIFF} >> ${REPORT}
73-
echo "\`\`\`" >> ${REPORT}
74-
echo "" >> ${REPORT}
75-
echo "</details>" >> ${REPORT}
76-
fi
77-
78-
# Save PR number for comment publication
79-
echo "${{ github.event.number }}" > ./benchmark-results/NR
80-
8150
- name: Upload Playwright Test assets
8251
if: always()
8352
uses: actions/upload-artifact@v2

.yarnrc.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
enableImmutableInstalls: false
2+
3+
nodeLinker: node-modules

hatch_build.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
from urllib.request import urlopen
66

77

8-
JUPYTERLAB_APPUTILS_VERSION = "3.2.8"
9-
JUPYTERLAB_THEME_LIGHT_VERSION = "3.2.8"
8+
JUPYTERLAB_APPUTILS_VERSION = "4.1.2"
9+
JUPYTERLAB_THEME_LIGHT_VERSION = "4.0.2"
1010

1111
CSS_FILES = [
1212
(

lerna.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
22
"npmClient": "yarn",
3-
"version": "independent",
4-
"useWorkspaces": true
3+
"version": "independent"
54
}

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,8 @@
2222
"build:prod": "lerna run build:prod",
2323
"build:test": "lerna run build:test",
2424
"clean": "lerna run clean",
25-
"eslint": "eslint . --ext .ts,.tsx,.js,.jsx --fix",
26-
"eslint:check": "eslint . --ext .ts,.tsx,.js,.jsx",
27-
"install": "lerna bootstrap",
25+
"eslint": "eslint . --ext .ts,.tsx --fix",
26+
"eslint:check": "eslint . --ext .ts,.tsx",
2827
"prettier": "prettier --write \"**/*{.ts,.tsx,.js,.jsx,.css,.json,.md}\"",
2928
"prettier:check": "prettier --list-different \"**/*{.ts,.tsx,.js,.jsx,.css,.json,.md}\"",
3029
"test": "lerna run test"

packages/jupyterlab-preview/package.json

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -46,33 +46,32 @@
4646
"watch:src": "tsc -w"
4747
},
4848
"dependencies": {
49-
"@jupyterlab/application": "^3.0.0",
50-
"@jupyterlab/apputils": "^3.0.0",
51-
"@jupyterlab/coreutils": "^5.0.0",
52-
"@jupyterlab/docregistry": "^3.0.0",
53-
"@jupyterlab/fileeditor": "^3.0.0",
54-
"@jupyterlab/mainmenu": "^3.0.0",
55-
"@jupyterlab/notebook": "^3.0.0",
56-
"@jupyterlab/settingregistry": "^3.0.0",
57-
"@jupyterlab/ui-components": "^3.0.0",
58-
"@lumino/coreutils": "^1.5.3",
59-
"@lumino/signaling": "^1.4.3",
49+
"@jupyterlab/application": "^3 || ^4",
50+
"@jupyterlab/apputils": "^3 || ^4",
51+
"@jupyterlab/coreutils": "^5 || ^6",
52+
"@jupyterlab/docregistry": "^3 || ^4",
53+
"@jupyterlab/fileeditor": "^3 || ^4",
54+
"@jupyterlab/mainmenu": "^3 || ^4",
55+
"@jupyterlab/notebook": "^3 || ^4",
56+
"@jupyterlab/settingregistry": "^3 || ^4",
57+
"@jupyterlab/ui-components": "^3 || ^4",
58+
"@lumino/coreutils": "^1.5.3 || ^2",
59+
"@lumino/signaling": "^1.4.3 || ^2",
6060
"react": "^17.0.1",
6161
"react-dom": "^17.0.1"
6262
},
6363
"devDependencies": {
6464
"@babel/core": "^7.10.2",
6565
"@babel/preset-env": "^7.10.2",
66-
"@jupyterlab/builder": "^3.0.0",
67-
"@jupyterlab/testutils": "^3.0.0",
66+
"@jupyterlab/builder": "^4",
6867
"@types/react": "^17.0.0",
6968
"@types/react-dom": "^17.0.0",
7069
"rimraf": "^2.6.1",
71-
"typescript": "~4.1.3"
70+
"source-map-loader": "~1.0.2",
71+
"typescript": "~5"
7272
},
7373
"jupyterlab": {
7474
"extension": true,
75-
"webpackConfig": "webpack.lab.config.js",
7675
"schemaDir": "schema",
7776
"outputDir": "../../voila/labextension",
7877
"discovery": {

packages/jupyterlab-preview/webpack.lab.config.js

Lines changed: 0 additions & 6 deletions
This file was deleted.

packages/voila/package.json

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,25 @@
88
"main": "lib/index.js",
99
"browserslist": ">0.8%, not ie 11, not op_mini all, not dead",
1010
"dependencies": {
11-
"@jupyter-widgets/base": "^6.0.1",
12-
"@jupyter-widgets/controls": "^5.0.1",
13-
"@jupyter-widgets/jupyterlab-manager": "^5.0.3",
14-
"@jupyterlab/application": "^3.0.0",
15-
"@jupyterlab/apputils": "^3.0.0",
16-
"@jupyterlab/coreutils": "^5.0.0",
17-
"@jupyterlab/docregistry": "^3.0.0",
18-
"@jupyterlab/javascript-extension": "~3.0.0",
19-
"@jupyterlab/notebook": "^3.0.0",
20-
"@jupyterlab/outputarea": "^3.0.0",
21-
"@jupyterlab/rendermime": "^3.0.0",
11+
"@jupyter-widgets/base": "^6.0.5",
12+
"@jupyter-widgets/controls": "^5.0.6",
13+
"@jupyter-widgets/jupyterlab-manager": "^5.0.8",
14+
"@jupyterlab/application": "^3 || ^4",
15+
"@jupyterlab/apputils": "^3 || ^4",
16+
"@jupyterlab/coreutils": "^5 || ^6",
17+
"@jupyterlab/docregistry": "^3 || ^4 || ^5",
18+
"@jupyterlab/javascript-extension": "^3 || ^4",
19+
"@jupyterlab/notebook": "^3 || ^4",
20+
"@jupyterlab/outputarea": "^3 || ^4",
21+
"@jupyterlab/rendermime": "^3 || ^4",
2222
"@jupyterlab/services": "^6.1.8",
23-
"@lumino/algorithm": "^1.3.3",
24-
"@lumino/commands": "^1.12.0",
25-
"@lumino/domutils": "^1.2.3",
26-
"@lumino/messaging": "^1.4.3",
27-
"@lumino/signaling": "^1.4.3",
28-
"@lumino/virtualdom": "^1.8.0",
29-
"@lumino/widgets": "^1.18.0",
23+
"@lumino/algorithm": "^1.3.3 || ^2",
24+
"@lumino/commands": "^1.12.0 || ^2",
25+
"@lumino/domutils": "^1.2.3 || ^2",
26+
"@lumino/messaging": "^1.4.3 || ^2",
27+
"@lumino/signaling": "^1.4.3 || ^2",
28+
"@lumino/virtualdom": "^1.8.0 || ^2",
29+
"@lumino/widgets": "^1.18.0 || ^2",
3030
"mathjax-full": "^3.0.0"
3131
},
3232
"devDependencies": {
@@ -40,7 +40,7 @@
4040
"style-loader": "^2.0.0",
4141
"typescript": "~4.1.3",
4242
"url-loader": "^1.0.0",
43-
"webpack": "^4.29.3",
43+
"webpack": "^5",
4444
"webpack-cli": "^3.2.3"
4545
},
4646
"style": "style/index.css",

packages/voila/style/index.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@import '@jupyter-widgets/controls/css/widgets-base.css';
2+
13
@font-face /* 0 */ {
24
font-family: MJXZERO;
35
src: url('~mathjax-full/es5/output/chtml/fonts/woff-v2/MathJax_Zero.woff')

packages/voila/webpack.config.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ module.exports = [
5656
path: distRoot,
5757
libraryTarget: 'amd'
5858
},
59-
module: { rules: rules },
60-
devtool: 'source-map'
59+
module: { rules: rules }
6160
}
6261
];

0 commit comments

Comments
 (0)