Skip to content

Commit 03f8567

Browse files
authored
Revert "Enable Python API in the JupyterLite deployment" (#685)
Revert "Enable Python API in the JupyterLite deployment (#680)" This reverts commit 1611a56.
1 parent daccf59 commit 03f8567

File tree

19 files changed

+84
-107
lines changed

19 files changed

+84
-107
lines changed

.github/workflows/build.yml

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
yarn=3
2626
2727
- name: Setup pip cache
28-
uses: actions/cache@v4
28+
uses: actions/cache@v2
2929
with:
3030
path: ~/.cache/pip
3131
key: pip-3.9-${{ hashFiles('package.json') }}
@@ -38,7 +38,7 @@ jobs:
3838
run: echo "::set-output name=dir::$(yarn cache dir)"
3939

4040
- name: Setup yarn cache
41-
uses: actions/cache@v4
41+
uses: actions/cache@v2
4242
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
4343
with:
4444
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
@@ -47,7 +47,7 @@ jobs:
4747
yarn-
4848
4949
- name: Setup OpenCascade build cache
50-
uses: actions/cache@v4
50+
uses: actions/cache@v2
5151
with:
5252
path: |
5353
packages/opencascade/lib/jupytercad.opencascade.js
@@ -84,7 +84,6 @@ jobs:
8484
python/jupytercad_core/dist/jupytercad*
8585
python/jupytercad_lab/dist/jupytercad*
8686
python/jupytercad_app/dist/jupytercad*
87-
python/jupytercad/dist/jupytercad*
8887
if-no-files-found: error
8988

9089
test_isolated:
@@ -149,7 +148,7 @@ jobs:
149148
shell: bash -l {0}
150149
run: |
151150
set -eux
152-
cp ./jupytercad_core/dist/jupytercad*.whl ./jupytercad_lab/dist/jupytercad*.whl ./jupytercad_app/dist/jupytercad*.whl ./jupytercad/dist/jupytercad*.whl .
151+
cp ./jupytercad_core/dist/jupytercad*.whl ./jupytercad_lab/dist/jupytercad*.whl ./jupytercad_app/dist/jupytercad*.whl .
153152
python -m pip install jupytercad*.whl
154153
155154
- name: Install dependencies
@@ -160,7 +159,7 @@ jobs:
160159
run: jlpm install
161160

162161
- name: Set up browser cache
163-
uses: actions/cache@v4
162+
uses: actions/cache@v3
164163
with:
165164
path: |
166165
${{ github.workspace }}/pw-browsers
@@ -222,7 +221,6 @@ jobs:
222221
pip
223222
jupyterlite-core
224223
jupyterlite-xeus
225-
jupyter_server
226224
227225
- name: Download extension package
228226
uses: actions/download-artifact@v4
@@ -233,16 +231,15 @@ jobs:
233231
shell: bash -l {0}
234232
run: |
235233
set -eux
236-
cp ./jupytercad_core/dist/jupytercad*.whl jupytercad_core-0.0.1-py3-none-any.whl
237-
cp ./jupytercad_lab/dist/jupytercad*.whl jupytercad_lab-0.0.1-py3-none-any.whl
238-
cp ./jupytercad_app/dist/jupytercad*.whl jupytercad_app-0.0.1-py3-none-any.whl
234+
cp ./jupytercad_core/dist/jupytercad*.whl ./jupytercad_lab/dist/jupytercad*.whl ./jupytercad_app/dist/jupytercad*.whl .
235+
python -m pip install jupytercad*.whl
239236
240237
- name: Build the lite site
241238
shell: bash -l {0}
242239
working-directory: lite
243240
run: |
244241
set -eux
245-
mkdir -p content && cp ../examples/*.jcad ../examples/*.STEP ../examples/*.stl ../examples/*.ipynb ./content
242+
mkdir -p content && cp ../examples/*.jcad ../examples/*.STEP ../examples/*.stl ./content
246243
jupyter lite build --contents content --output-dir dist
247244
248245
- name: Upload github-pages artifact

lite/environment.yml

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,6 @@
11
name: xeus-python-kernel
22
channels:
3-
- https://prefix.dev/emscripten-forge-dev
4-
- https://prefix.dev/conda-forge
3+
- https://repo.mamba.pm/emscripten-forge
4+
- conda-forge
55
dependencies:
6-
- python=3.13
7-
- pip
86
- xeus-python
9-
- requests
10-
- jupyter_ydoc=2.1.5
11-
- ypywidgets>=0.9.6,<0.10.0
12-
- comm>=0.1.2,<0.2.0
13-
- pydantic>=2,<3
14-
- pip:
15-
- yjs-widgets>=0.4,<0.5
16-
- my-jupyter-shared-drive
17-
- ../jupytercad_core-0.0.1-py3-none-any.whl
18-
- ../jupytercad_lab-0.0.1-py3-none-any.whl

lite/jupyter-lite.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
{
22
"jupyter-lite-schema-version": 0,
3-
"jupyter-config-data": {}
3+
"jupyter-config-data": {
4+
"appName": "My JupyterCAD App",
5+
"disabledExtensions": [
6+
"@jupyter/collaboration-extension",
7+
"@jupyter/docprovider-extension"
8+
]
9+
}
410
}

packages/base/src/widget.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,12 +268,12 @@ export class JupyterCadPanel extends SplitPanel {
268268

269269
(this._consoleTracker.widgetAdded as any).emit(consolePanel);
270270
await consolePanel.sessionContext.ready;
271-
this.addWidget(this._consoleView);
272-
this.setRelativeSizes([2, 1]);
273-
this._consoleOpened = true;
274271
await consolePanel.console.inject(
275272
`from jupytercad_lab import CadDocument\ndoc = CadDocument("${jcadPath}")`
276273
);
274+
this.addWidget(this._consoleView);
275+
this.setRelativeSizes([2, 1]);
276+
this._consoleOpened = true;
277277
consolePanel.console.sessionContext.kernelChanged.connect((_, arg) => {
278278
if (!arg.newValue) {
279279
this.removeConsole();

python/jupytercad/pyproject.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ dependencies = [
2222
"jupytercad_core==3.0.1",
2323
"jupytercad_lab==3.0.1",
2424
"jupytercad_app==3.0.1",
25-
"jupyter-collaboration>=3,<4",
26-
"jupyterlab>=4.3,<5",
2725
]
2826
dynamic = ["version"]
2927
license = {file = "LICENSE"}

python/jupytercad_app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
"@lumino/widgets": "^2.0.0",
109109
"react": "^18.0.1",
110110
"yjs": "^13.5.40",
111-
"yjs-widgets": "^0.4"
111+
"yjs-widgets": "^0.3.7"
112112
},
113113
"devDependencies": {
114114
"@jupyterlab/builder": "^4.0.0",

python/jupytercad_core/jupytercad_core/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
warnings.warn("Importing 'jupytercad_core' outside a proper installation.")
1010
__version__ = "dev"
1111

12+
from .handlers import setup_handlers
13+
1214

1315
def _jupyter_labextension_paths():
1416
return [{"src": "labextension", "dest": "@jupytercad/jupytercad-core"}]
@@ -22,7 +24,5 @@ def _load_jupyter_server_extension(server_app):
2224
server_app: jupyterlab.labapp.LabApp
2325
JupyterLab application instance
2426
"""
25-
from .handlers import setup_handlers
26-
2727
setup_handlers(server_app.web_app)
2828
server_app.log.info("Registered jupytercad server extension")

python/jupytercad_core/pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ classifiers = [
1919
"Programming Language :: Python :: 3.12",
2020
]
2121
dependencies = [
22+
"jupyter_server>=2.0.6,<3",
2223
"jupyter_ydoc>=2,<4",
24+
"jupyter-collaboration>=3.1.0,<4",
2325
"pydantic>=2,<3",
2426
]
2527
dynamic = ["version", "description", "authors", "urls", "keywords"]

python/jupytercad_core/src/jcadplugin/modelfactory.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ export class JupyterCadJcadModelFactory
1919
/**
2020
* Whether the model is collaborative or not.
2121
*/
22-
readonly collaborative = true;
22+
readonly collaborative =
23+
document.querySelectorAll('[data-jupyter-lite-root]')[0] === undefined;
2324

2425
/**
2526
* The name of the model.

python/jupytercad_core/src/stepplugin/modelfactory.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ export class JupyterCadStepModelFactory
2323
/**
2424
* Whether the model is collaborative or not.
2525
*/
26-
readonly collaborative = true;
26+
readonly collaborative =
27+
document.querySelectorAll('[data-jupyter-lite-root]')[0] === undefined;
2728

2829
/**
2930
* The name of the model.

0 commit comments

Comments
 (0)