Skip to content

Commit e28da3c

Browse files
authored
Merge pull request #15 from Kitware/jupyter
feat: adding jupyter extension to run as app
2 parents 5bb8a18 + 788ba23 commit e28da3c

File tree

4 files changed

+47
-0
lines changed

4 files changed

+47
-0
lines changed

pyproject.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ tauri = [
4040
vue2 = [
4141
"trame-grid-layout>=1.0.3",
4242
]
43+
jupyter = [
44+
"jupyter-server-proxy>=4.0.0",
45+
]
4346

4447

4548
[build-system]
@@ -53,6 +56,7 @@ include = [
5356
"/src/e3sm_quickview/data/**",
5457
"/src/e3sm_quickview/assets/**",
5558
"/src/e3sm_quickview/module/**",
59+
"/src/e3sm_quickview/jupyter/**",
5660
]
5761

5862
[tool.hatch.build.targets.wheel]
@@ -64,6 +68,9 @@ packages = [
6468
quickview-vue2 = "e3sm_quickview.app:main"
6569
quickview = "e3sm_quickview.app:main"
6670

71+
[project.entry-points."jupyter_serverproxy_servers"]
72+
quickview = "e3sm_quickview.jupyter:setup_quickview"
73+
6774
[tool.ruff.lint.per-file-ignores]
6875
# Ignore star import issues in ParaView plugins
6976
"e3sm_quickview/plugins/*.py" = ["F403", "F405"]
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
"""Jupyter integration for QuickView via jupyter-server-proxy."""
2+
3+
from .proxy import setup_quickview
4+
5+
__all__ = ["setup_quickview"]
135 KB
Loading
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
"""Server proxy configuration for QuickView in JupyterLab."""
2+
3+
import os
4+
5+
6+
def setup_quickview():
7+
"""Configure jupyter-server-proxy for QuickView.
8+
9+
Returns a dictionary with the server process configuration that
10+
jupyter-server-proxy uses to launch and proxy QuickView.
11+
"""
12+
icon_path = os.path.join(
13+
os.path.dirname(os.path.abspath(__file__)),
14+
"icons",
15+
"quickview.png",
16+
)
17+
18+
return {
19+
"command": [
20+
"quickview",
21+
"--server",
22+
"--port",
23+
"{port}",
24+
"--host",
25+
"127.0.0.1",
26+
],
27+
"timeout": 30,
28+
"launcher_entry": {
29+
"enabled": True,
30+
"title": "QuickView",
31+
"icon_path": icon_path,
32+
"category": "Other",
33+
},
34+
"new_browser_tab": False,
35+
}

0 commit comments

Comments
 (0)