Skip to content

Commit 5f37470

Browse files
committed
belt and suspenders serverextension for notebook classic
1 parent 388b3d8 commit 5f37470

File tree

8 files changed

+38
-13
lines changed

8 files changed

+38
-13
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,13 +170,20 @@ jobs:
170170
cd dist
171171
${{ matrix.python-cmd }} -c "import jupyter_videochat; print(jupyter_videochat.__version__)"
172172
173-
- name: Validate Server Extension
173+
- name: Validate Server Extension (server)
174174
run: |
175175
set -eux
176-
jupyter serverextension list --debug 1>serverextensions 2>&1
176+
jupyter server extension list --debug 1>serverextensions 2>&1
177177
cat serverextensions
178178
cat serverextensions | grep -i "jupyter_videochat.*OK"
179179
180+
- name: Validate Server Extension (notebook)
181+
run: |
182+
set -eux
183+
jupyter serverextension list --debug 1>server_extensions 2>&1
184+
cat server_extensions
185+
cat server_extensions | grep -i "jupyter_videochat.*OK"
186+
180187
- name: Validate Lab Extension
181188
run: |
182189
set -eux

MANIFEST.in

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
include LICENSE
2-
include README.md
3-
4-
include jupyter-config/jupyter_videochat.json
5-
include install.json
1+
include LICENSE README.md install.json
62

3+
recursive-include jupyter-config *.json
74
recursive-include jupyter_videochat/labextension *.*
85

96
# Javascript files

binder/postBuild

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,16 @@ jlpm bootstrap
55

66
python -m pip install -e . --ignore-installed --no-deps -vv
77

8+
# squash build warning
89
jupyter labextension disable jupyter-offlinenotebook || echo "not enabled"
910
jupyter labextension uninstall --no-build jupyter-offlinenotebook || echo "not installed"
1011

12+
# install our extensions
1113
jupyter labextension develop --overwrite .
1214
jupyter serverextension enable --sys-prefix --py jupyter_videochat
15+
jupyter server extension enable --sys-prefix --py jupyter_videochat
1316

17+
# list all extensions
18+
jupyter server extension list
1419
jupyter serverextension list
1520
jupyter labextension list

install.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"packageManager": "python",
3-
"packageName": "jupyter_videochat",
4-
"uninstallInstructions": "Use your Python package manager (pip, conda, etc.) to uninstall the package `jupyter_videochat`"
3+
"packageName": "jupyter-videochat",
4+
"uninstallInstructions": "Use your Python package manager (pip, conda, etc.) to uninstall the package jupyter-videochat"
55
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"NotebookApp": {
3+
"nbserver_extensions": {
4+
"jupyter_videochat": true
5+
}
6+
}
7+
}

jupyter_videochat/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,3 +78,7 @@ def load_jupyter_server_extension(lab_app):
7878
videochat = VideoChat(parent=lab_app)
7979
lab_app.web_app.settings['videochat'] = videochat
8080
setup_handlers(lab_app.web_app)
81+
82+
83+
# For backward compatibility
84+
_load_jupyter_server_extension = load_jupyter_server_extension

setup.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
from setuptools import setup
55

6-
CONF_D = "etc/jupyter/jupyter_server_config.d"
6+
ETC = "etc/jupyter"
77

88
HERE = Path(__file__).parent
99
EXT_SRC = HERE / "jupyter_videochat" / "labextension"
@@ -54,11 +54,16 @@
5454
DATA_FILES += [
5555
# percolates up to the UI about the installed labextension
5656
(EXT_DEST, ["install.json"]),
57-
# enables the serverextension
58-
(CONF_D, ["jupyter-config/jupyter_videochat.json"]),
57+
# enables the serverextension under various apps
58+
*[
59+
(
60+
f"{ETC}/jupyter_{app}_config.d",
61+
[f"jupyter-config/jupyter_{app}_config.d/jupyter_videochat.json"]
62+
)
63+
for app in ["notebook", "server"]
64+
]
5965
]
6066

61-
6267
if __name__ == "__main__":
6368
setup(
6469
version=__jspackage__["version"],

0 commit comments

Comments
 (0)