Skip to content

Commit

Permalink
feat(v3/4): Make it jupyter lab 3/4 compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
jourdain committed Oct 3, 2023
1 parent e2ae3dc commit 715c30f
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 36 deletions.
13 changes: 0 additions & 13 deletions examples/vtk_remote_rendering.ipynb
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "0687f4ca-ee4c-493e-a76d-9102496244d6",
"metadata": {},
"outputs": [],
"source": [
"import os\n",
"os.environ[\"TRAME_DISABLE_V3_WARNING\"] = \"1\"\n",
"os.environ[\"TRAME_IFRAME_BUILDER\"] = \"jupyter-extension\"\n",
"os.environ[\"TRAME_BACKEND\"] = \"jupyter\""
]
},
{
"cell_type": "code",
"execution_count": 2,
Expand Down
44 changes: 26 additions & 18 deletions examples/vue23.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@
"output_type": "stream",
"text": [
"Task was destroyed but it is pending!\n",
"task: <Task pending name='Task-6' coro=<GenericServer.start() done, defined at /Users/sebastien.jourdain/Documents/code/web/trame-suite/trame-jupyter-extension/.venv/lib/python3.9/site-packages/wslink/backends/generic/core.py:110> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x1103ff940>()]> cb=[Server.start.<locals>.on_done() at /Users/sebastien.jourdain/Documents/code/web/trame-suite/trame-jupyter-extension/.venv/lib/python3.9/site-packages/trame_server/core.py:595]>\n",
"Task was destroyed but it is pending!\n",
"task: <Task pending name='Task-7' coro=<GenericServer.start() done, defined at /Users/sebastien.jourdain/Documents/code/web/trame-suite/trame-jupyter-extension/.venv/lib/python3.9/site-packages/wslink/backends/generic/core.py:110> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x110540550>()]> cb=[Server.start.<locals>.on_done() at /Users/sebastien.jourdain/Documents/code/web/trame-suite/trame-jupyter-extension/.venv/lib/python3.9/site-packages/trame_server/core.py:595]>\n"
"task: <Task pending name='Task-6' coro=<GenericServer.start() done, defined at /Users/sebastien.jourdain/Documents/code/web/trame-suite/.venv/lib/python3.9/site-packages/wslink/backends/generic/core.py:110> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x10393f7f0>()]> cb=[Server.start.<locals>.on_done() at /Users/sebastien.jourdain/Documents/code/web/trame-suite/.venv/lib/python3.9/site-packages/trame_server/core.py:595]>\n"
]
},
{
Expand Down Expand Up @@ -70,13 +68,8 @@
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "18f70ee64b7246a99a48e030d700f571",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"HTML(value='<iframe id=\"vue2_trame__template_main\" src=\"/trame-jupyter-server/vue2/index.html?ui=main&server=v…"
"text/html": [
"<iframe id=\"vue2_trame__template_main\" src=\"/trame-jupyter-server/servers/vue2/index.html?ui=main&server=vue2&wsProxy&reconnect=auto\" data-kernel-id=\"065f5718-43b3-48dc-8969-7963f3c69fb6\" style=\"border: none; width: 100%; height: 45px;\"></iframe>"
]
},
"metadata": {},
Expand All @@ -95,13 +88,8 @@
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "d072c8d647ef401190225ebc11de6907",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"HTML(value='<iframe id=\"vue3_trame__template_main\" src=\"/trame-jupyter-server/vue3/index.html?ui=main&server=v…"
"text/html": [
"<iframe id=\"vue3_trame__template_main\" src=\"/trame-jupyter-server/servers/vue3/index.html?ui=main&server=vue3&wsProxy&reconnect=auto\" data-kernel-id=\"065f5718-43b3-48dc-8969-7963f3c69fb6\" style=\"border: none; width: 100%; height: 45px;\"></iframe>"
]
},
"metadata": {},
Expand Down Expand Up @@ -181,9 +169,29 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 5,
"id": "22ade450-dbb7-41cd-a8dd-7784b702044f",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"/var/folders/p_/hxjn_q0j2kg_16rfcdlc259hs_3p6n/T/tmp9dg6rj91\n"
]
}
],
"source": [
"import os\n",
"\n",
"print(os.environ.get(\"TRAME_JUPYTER_EXTENSION\"))"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "eb35c430-923a-4288-b05b-508b9d1dd094",
"metadata": {},
"outputs": [],
"source": []
}
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "trame-jupyter-extension",
"version": "0.1.2",
"version": "0.1.3",
"description": "A JupyterLab extension for trame communication layer",
"keywords": [
"jupyter",
Expand Down Expand Up @@ -54,7 +54,7 @@
"watch:labextension": "jupyter labextension watch ."
},
"dependencies": {
"@jupyterlab/application": "^4.0.0",
"@jupyterlab/application": "^3.5.0 || ^4.0.5",
"@jupyterlab/coreutils": "^6.0.0",
"@jupyterlab/services": "^7.0.0"
},
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ classifiers = [
"Programming Language :: Python :: 3.11",
]
dependencies = [
"jupyterlab >=3.5,<5",
"jupyter_server>=2.0.1,<3",
"trame>=3.2.7",
]
Expand Down Expand Up @@ -69,7 +70,7 @@ version_cmd = "hatch version"

[tool.jupyter-releaser.hooks]
before-build-npm = [
"python -m pip install 'jupyterlab>=4.0.0,<5'",
"python -m pip install 'jupyterlab >=3.5,<5'",
"jlpm",
"jlpm build:prod"
]
Expand Down
4 changes: 2 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ __metadata:
languageName: node
linkType: hard

"@jupyterlab/application@npm:^4.0.0":
"@jupyterlab/application@npm:^3.5.0 || ^4.0.5":
version: 4.0.6
resolution: "@jupyterlab/application@npm:4.0.6"
dependencies:
Expand Down Expand Up @@ -5182,7 +5182,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "trame-jupyter-extension@workspace:."
dependencies:
"@jupyterlab/application": ^4.0.0
"@jupyterlab/application": ^3.5.0 || ^4.0.5
"@jupyterlab/builder": ^4.0.0
"@jupyterlab/coreutils": ^6.0.0
"@jupyterlab/services": ^7.0.0
Expand Down

0 comments on commit 715c30f

Please sign in to comment.