Skip to content

Commit a55f65a

Browse files
committed
Test against jupyter_server 1 and notebook 5 and 7
1 parent eb388a1 commit a55f65a

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

.github/workflows/test.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ jobs:
2828
matrix:
2929
include:
3030
- python-version: "3.7"
31+
pip-install: "jupyter_server==1.* notebook==5.*"
3132
- python-version: "3.8"
33+
pip-install: "jupyter_server==1.* notebook==6.*"
3234
# 2.17 is in ubuntu 18.04
3335
git-version: "2.17"
3436
- python-version: "3.9"
@@ -73,8 +75,7 @@ jobs:
7375
7476
- name: Install dependencies
7577
run: |
76-
pip install -r dev-requirements.txt
77-
pip install .
78+
pip install -r dev-requirements.txt ${{ matrix.pip-install }} .
7879
7980
- name: List dependencies
8081
run: |

dev-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
jupyter-packaging>=0.10
22
nbclassic
3-
notebook>=5.5,<7
3+
notebook>=5.5
44
packaging
55
pytest
66
pytest-cov

tests/test_api.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import time
55
from urllib.parse import urlencode
66
from uuid import uuid4
7+
import notebook
78
import pytest
89

910
from repohelpers import Pusher, Remote
@@ -65,21 +66,24 @@ def jupyter_server(request, tmpdir, jupyterdir):
6566
if extra_env:
6667
env.update(extra_env)
6768

69+
extension_command = ["jupyter", "server", "extension"]
6870
if backend_type == "jupyter-server":
6971
command = [
7072
'jupyter-server',
7173
'--ServerApp.token=secret',
7274
'--port={}'.format(PORT),
7375
]
74-
extension_command = ["jupyter", "server", "extension"]
7576
elif backend_type == "jupyter-notebook":
7677
command = [
7778
'jupyter-notebook',
7879
'--no-browser',
7980
'--NotebookApp.token=secret',
8081
'--port={}'.format(PORT),
8182
]
82-
extension_command = ["jupyter", "serverextension"]
83+
# notebook <7 require "jupyter serverextension" instead of "jupyter
84+
# server extension"
85+
if notebook.version_info[0] < 7:
86+
extension_command = ["jupyter", "serverextension"]
8387
else:
8488
raise ValueError(
8589
f"backend_type must be 'jupyter-server' or 'jupyter-notebook' not {backend_type!r}"

0 commit comments

Comments
 (0)