Skip to content

Commit baaa176

Browse files
trungleducjabbera
authored andcommitted
Migrating to jupyter-server 2, jupyter_client 7.x (voila-dashboards#1308)
* Get changes from voila-dashboards#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)
1 parent d5d422b commit baaa176

File tree

15 files changed

+17789
-14072
lines changed

15 files changed

+17789
-14072
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: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ 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.9', '3.10']
2323

2424
steps:
2525
- uses: actions/checkout@v2
@@ -32,7 +32,7 @@ jobs:
3232

3333
- name: Create the conda environment
3434
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"
35+
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
3636

3737
- name: Install dependencies
3838
shell: bash -l {0}
@@ -69,7 +69,7 @@ jobs:
6969
fail-fast: false
7070
matrix:
7171
os: [macos-10.15]
72-
python_version: ['3.7', '3.8', '3.9', '3.10']
72+
python_version: ['3.8', '3.9', '3.10']
7373

7474
steps:
7575
- uses: actions/checkout@v2
@@ -82,7 +82,7 @@ jobs:
8282

8383
- name: Create the conda environment
8484
shell: bash -l {0}
85-
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"
85+
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
8686

8787
- name: Install dependencies
8888
shell: bash -l {0}
@@ -113,7 +113,7 @@ jobs:
113113
fail-fast: false
114114
matrix:
115115
os: [windows-latest]
116-
python-version: ['3.7', '3.8', '3.9', '3.10']
116+
python-version: ['3.8', '3.9', '3.10']
117117
steps:
118118
- uses: actions/checkout@v2
119119

@@ -124,11 +124,11 @@ jobs:
124124

125125
- uses: actions/setup-node@v2
126126
with:
127-
node-version: '16'
127+
node-version: '18'
128128

129129
- name: Install dependencies
130130
run: |
131-
python -m pip install jupyterlab_pygments==0.1.0 pytest-cov pytest-rereunfailures flake8 ipywidgets matplotlib traitlets
131+
python -m pip install jupyterlab_pygments==0.1.0 pytest-cov pytest-rerunfailures ipywidgets matplotlib traitlets ipykernel
132132
yarn install --network-timeout 100000
133133
python -m pip install ".[test]"
134134
cd tests/test_template

.github/workflows/packaging.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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'

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +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",
25+
"eslint": "eslint . --ext .ts,.tsx --fix",
26+
"eslint:check": "eslint . --ext .ts,.tsx",
2727
"install": "lerna bootstrap",
2828
"prettier": "prettier --write \"**/*{.ts,.tsx,.js,.jsx,.css,.json,.md}\"",
2929
"prettier:check": "prettier --list-different \"**/*{.ts,.tsx,.js,.jsx,.css,.json,.md}\"",

pyproject.toml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ build-backend = "hatchling.build"
1010
name = "voila"
1111
description = "Voilà turns Jupyter notebooks into standalone web applications"
1212
readme = "README.md"
13-
requires-python = ">=3.7"
13+
requires-python = ">=3.8"
1414
authors = [
1515
{ name = "Voila Development Team" },
1616
]
@@ -34,9 +34,9 @@ classifiers = [
3434
"Programming Language :: Python :: 3.10",
3535
]
3636
dependencies = [
37-
"jupyter_client>=6.1.3,<=7.4.1",
37+
"jupyter_client>=7.4.4,<9",
3838
"jupyter_core>=4.11.0",
39-
"jupyter_server>=1.18,<2.0.0",
39+
"jupyter_server>=2.0.0,<3",
4040
"jupyterlab_server>=2.3.0,<3",
4141
"nbclient>=0.4.0,<0.8",
4242
"nbconvert>=6.4.5,<8",
@@ -64,7 +64,6 @@ test = [
6464
"pandas",
6565
"papermill",
6666
"pytest",
67-
"pytest-rerunfailures",
6867
"pytest-tornasync",
6968
]
7069

tests/app/shutdown_kernel_test.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
import re
2+
import pytest
3+
4+
5+
@pytest.fixture
6+
def voila_config():
7+
def config(voila_app):
8+
voila_app.tornado_settings["disable_check_xsrf"] = True
9+
10+
return config
211

312

413
async def test_shutdown_handler(http_server_client, base_url):

tests/execute_output_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def test_execute_output():
3939
path = os.path.join(BASE_DIR, 'notebooks/output.ipynb')
4040
nb = read(path, NO_CONVERT)
4141
nb_voila = deepcopy(nb)
42-
executenb(nb_voila)
42+
executenb(nb_voila, timeout=30)
4343

4444
widget_states = nb.metadata.widgets[WIDGET_MIME_TYPE_STATE]['state']
4545
widget_states_voila = nb_voila.metadata.widgets[WIDGET_MIME_TYPE_STATE][

tests/notebooks/output.ipynb

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
],
2424
"source": [
2525
"import ipywidgets as widgets\n",
26-
"from IPython.display import clear_output\n",
2726
"output1 = widgets.Output()\n",
2827
"output1"
2928
]
@@ -79,7 +78,6 @@
7978
}
8079
],
8180
"source": [
82-
"import ipywidgets as widgets\n",
8381
"output2 = widgets.Output()\n",
8482
"output2"
8583
]
@@ -100,8 +98,7 @@
10098
"source": [
10199
"print(\"hi2\")\n",
102100
"with output2:\n",
103-
" print(\"in output2\")\n",
104-
" clear_output(wait=True)"
101+
" print(\"in output2\")\n"
105102
]
106103
},
107104
{
@@ -126,7 +123,6 @@
126123
}
127124
],
128125
"source": [
129-
"import ipywidgets as widgets\n",
130126
"output3 = widgets.Output()\n",
131127
"output3"
132128
]
@@ -148,7 +144,6 @@
148144
"print(\"hi3\")\n",
149145
"with output3:\n",
150146
" print(\"hello\")\n",
151-
" clear_output(wait=True)\n",
152147
" print(\"world\")"
153148
]
154149
},
@@ -174,7 +169,6 @@
174169
}
175170
],
176171
"source": [
177-
"import ipywidgets as widgets\n",
178172
"output4 = widgets.Output()\n",
179173
"output4"
180174
]
@@ -195,8 +189,7 @@
195189
"source": [
196190
"print(\"hi4\")\n",
197191
"with output4:\n",
198-
" print(\"hello world\")\n",
199-
" clear_output()"
192+
" print(\"hello world\")\n"
200193
]
201194
},
202195
{
@@ -221,7 +214,6 @@
221214
}
222215
],
223216
"source": [
224-
"import ipywidgets as widgets\n",
225217
"output5 = widgets.Output()\n",
226218
"output5"
227219
]
@@ -234,8 +226,7 @@
234226
"source": [
235227
"print(\"hi5\")\n",
236228
"with output5:\n",
237-
" display(\"hello world\") # this is not a stream but plain text\n",
238-
"clear_output()"
229+
" display(\"hello world\") # this is not a stream but plain text\n"
239230
]
240231
},
241232
{
@@ -260,7 +251,6 @@
260251
}
261252
],
262253
"source": [
263-
"import ipywidgets as widgets\n",
264254
"output_outer = widgets.Output()\n",
265255
"output_inner = widgets.Output()\n",
266256
"output_inner"
@@ -296,13 +286,7 @@
296286
"execution_count": 14,
297287
"metadata": {},
298288
"outputs": [],
299-
"source": [
300-
"with output_inner:\n",
301-
" print('in inner')\n",
302-
" with output_outer:\n",
303-
" print('in outer')\n",
304-
" print('also in inner')"
305-
]
289+
"source": []
306290
},
307291
{
308292
"cell_type": "code",

0 commit comments

Comments
 (0)