Skip to content
This repository was archived by the owner on Feb 14, 2024. It is now read-only.

Commit fd0ca2a

Browse files
authoredDec 8, 2022
Merge pull request #86 from JohanMabille/upgrade
Upgraded to xeus-python 0.15
2 parents 5f03ff5 + a93b774 commit fd0ca2a

7 files changed

+12
-412
lines changed
 

‎Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ RUN micromamba create -n xeus-python-kernel \
1717
-c https://repo.mamba.pm/emscripten-forge \
1818
-c https://repo.mamba.pm/conda-forge \
1919
--yes \
20-
python=$PYTHON_VERSION xeus-python
20+
python=$PYTHON_VERSION xeus-python xeus-lite
2121

2222
RUN mkdir -p xeus-python-kernel && cd xeus-python-kernel && \
2323
cp /tmp/xeus-python-kernel/envs/xeus-python-kernel/bin/xpython_wasm.js . && \
2424
cp /tmp/xeus-python-kernel/envs/xeus-python-kernel/bin/xpython_wasm.wasm . && \
25-
empack pack python core /tmp/xeus-python-kernel/envs/xeus-python-kernel --version=$PYTHON_VERSION
25+
empack pack env --env-prefix /tmp/xeus-python-kernel/envs/xeus-python-kernel --outname python_data --config /opt/conda/share/empack/empack_config.yaml
2626

2727
COPY copy_output.sh .
2828

‎copy_output.sh

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ cd /tmp/xeus-python-kernel
77
ls
88
cp *python*.{js,wasm,data} /src/src
99

10+
cd /tmp/xeus-python-kernel/envs/xeus-python-kernel/share/xeus-lite
11+
cp *.ts /src/src
12+
1013
echo "============================================="
1114
echo "Compiling wasm bindings done"
1215
echo "============================================="

‎package.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@
4141
"build:prod": "jlpm run clean && jlpm run build:wasm && jlpm run build:lib && jlpm run build:worker:prod && jlpm run copy-files && jlpm run build:labextension",
4242
"build:labextension": "jupyter labextension build .",
4343
"build:labextension:dev": "jupyter labextension build --development True .",
44-
"build:lib": "tsc",
44+
"build:lib": " jlpm run sed-worker && tsc",
45+
"sed-worker": "shx sed -i \"s/XEUS_KERNEL_FILE/'.\\/xlua_wasm.js'/\" src/worker.ts && shx sed -i \"s/LANGUAGE_DATA_FILE/''/\" src/worker.ts ",
4546
"clean": "jlpm run clean:lib",
4647
"clean:lib": "rimraf lib tsconfig.tsbuildinfo",
4748
"clean:labextension": "rimraf jupyterlite_xeus_python/labextension",
@@ -76,7 +77,8 @@
7677
"prettier": "^2.1.1",
7778
"rimraf": "^3.0.2",
7879
"source-map-loader": "^4.0.0",
79-
"typescript": "~4.2.3"
80+
"typescript": "~4.2.3",
81+
"shx": "^0.3.0"
8082
},
8183
"sideEffects": [
8284
"style/*.css",

‎pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ build_cmd = "build:prod"
1414
npm = ["jlpm"]
1515

1616
[tool.check-manifest]
17-
ignore = ["share/jupyter/labextensions/@jupyterlite/xeus-python-kernel/**", "yarn.lock", ".*", "package-lock.json", "Dockerfile", "src/xpython_wasm.js", "src/xpython_wasm.wasm", "src/python_data.data", "src/python_data.js", "*.sh"]
17+
ignore = ["share/jupyter/labextensions/@jupyterlite/xeus-python-kernel/**", "yarn.lock", ".*", "package-lock.json", "Dockerfile", "src/xpython_wasm.js", "src/xpython_wasm.wasm", "src/python_data.data", "src/python_data.js", "src/worker.ts", "src/web_worker_kernel.ts", "*.sh"]

‎src/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010

1111
import { IKernel, IKernelSpecs } from '@jupyterlite/kernel';
1212

13-
import { XeusServerKernel } from './xeus_server_kernel';
13+
import { WebWorkerKernel } from './web_worker_kernel';
1414

1515
import logo32 from '!!file-loader?context=.!../style/logos/python-logo-32x32.png';
1616
import logo64 from '!!file-loader?context=.!../style/logos/python-logo-64x64.png';
@@ -36,7 +36,7 @@ const server_kernel: JupyterLiteServerPlugin<void> = {
3636
}
3737
},
3838
create: async (options: IKernel.IOptions): Promise<IKernel> => {
39-
return new XeusServerKernel({
39+
return new WebWorkerKernel({
4040
...options,
4141
mountDrive: serviceWorkerRegistrationWrapper.enabled
4242
});

‎src/worker.ts

-199
This file was deleted.

0 commit comments

Comments
 (0)