Skip to content

Commit

Permalink
Test against jupyter_server 1 and notebook 5 and 7
Browse files Browse the repository at this point in the history
  • Loading branch information
consideRatio committed Mar 28, 2024
1 parent eb388a1 commit a55f65a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ jobs:
matrix:
include:
- python-version: "3.7"
pip-install: "jupyter_server==1.* notebook==5.*"
- python-version: "3.8"
pip-install: "jupyter_server==1.* notebook==6.*"
# 2.17 is in ubuntu 18.04
git-version: "2.17"
- python-version: "3.9"
Expand Down Expand Up @@ -73,8 +75,7 @@ jobs:
- name: Install dependencies
run: |
pip install -r dev-requirements.txt
pip install .
pip install -r dev-requirements.txt ${{ matrix.pip-install }} .
- name: List dependencies
run: |
Expand Down
2 changes: 1 addition & 1 deletion dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
jupyter-packaging>=0.10
nbclassic
notebook>=5.5,<7
notebook>=5.5
packaging
pytest
pytest-cov
8 changes: 6 additions & 2 deletions tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import time
from urllib.parse import urlencode
from uuid import uuid4
import notebook
import pytest

from repohelpers import Pusher, Remote
Expand Down Expand Up @@ -65,21 +66,24 @@ def jupyter_server(request, tmpdir, jupyterdir):
if extra_env:
env.update(extra_env)

extension_command = ["jupyter", "server", "extension"]
if backend_type == "jupyter-server":
command = [
'jupyter-server',
'--ServerApp.token=secret',
'--port={}'.format(PORT),
]
extension_command = ["jupyter", "server", "extension"]
elif backend_type == "jupyter-notebook":
command = [
'jupyter-notebook',
'--no-browser',
'--NotebookApp.token=secret',
'--port={}'.format(PORT),
]
extension_command = ["jupyter", "serverextension"]
# notebook <7 require "jupyter serverextension" instead of "jupyter
# server extension"
if notebook.version_info[0] < 7:
extension_command = ["jupyter", "serverextension"]
else:
raise ValueError(
f"backend_type must be 'jupyter-server' or 'jupyter-notebook' not {backend_type!r}"
Expand Down

0 comments on commit a55f65a

Please sign in to comment.