Skip to content

Commit 011ffe2

Browse files
committed
Add JupyterLite deployment
1 parent b24fff3 commit 011ffe2

File tree

3 files changed

+92
-0
lines changed

3 files changed

+92
-0
lines changed
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
name: build and deploy
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
push:
7+
branches:
8+
- main
9+
10+
permissions:
11+
contents: read
12+
pages: write
13+
id-token: write
14+
15+
jobs:
16+
build:
17+
runs-on: ubuntu-latest
18+
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
include:
23+
- name: Github-page
24+
25+
steps:
26+
- uses: actions/checkout@v5
27+
with:
28+
fetch-depth: 0
29+
30+
- name: Install mamba
31+
uses: mamba-org/setup-micromamba@v2
32+
with:
33+
environment-file: environment-wasm-build.yml
34+
init-shell: bash
35+
environment-name: xeus-python-wasm-build
36+
37+
- name: Set ncpus
38+
run: echo "ncpus=$(nproc --all)" >> $GITHUB_ENV
39+
40+
- name: Build xeus-python
41+
shell: bash -l {0}
42+
run: |
43+
micromamba create -f environment-wasm-host.yml --platform=emscripten-wasm32
44+
45+
set -eux
46+
47+
export PREFIX=$MAMBA_ROOT_PREFIX/envs/xeus-python-wasm-host
48+
echo "PREFIX=$PREFIX" >> $GITHUB_ENV
49+
50+
emcmake cmake . \
51+
-DCMAKE_BUILD_TYPE=Release \
52+
-DCMAKE_PREFIX_PATH="$PREFIX" \
53+
-DCMAKE_SYSTEM_PREFIX_PATH="$PREFIX" \
54+
-DCMAKE_INSTALL_PREFIX="$PREFIX" \
55+
-DCMAKE_FIND_ROOT_PATH="$PREFIX" \
56+
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
57+
-DCMAKE_VERBOSE_MAKEFILE=ON
58+
59+
emmake make -j${{ env.ncpus }} install
60+
61+
- name: Jupyter Lite integration
62+
shell: bash -l {0}
63+
run: |
64+
jupyter lite build \
65+
--XeusAddon.prefix=${{ env.PREFIX }} \
66+
--XeusAddon.mounts=$PREFIX/share/xeus-python:/share/xeus-python \
67+
--contents notebooks/xeus-python.ipynb \
68+
--output-dir dist
69+
70+
- name: Upload artifact
71+
uses: actions/upload-pages-artifact@v4
72+
with:
73+
path: ./dist
74+
75+
deploy:
76+
needs: build
77+
if: github.ref == 'refs/heads/main'
78+
permissions:
79+
pages: write
80+
id-token: write
81+
82+
environment:
83+
name: github-pages
84+
url: ${{ steps.deployment.outputs.page_url }}
85+
86+
runs-on: ubuntu-latest
87+
steps:
88+
- name: Deploy to GitHub Pages
89+
id: deployment
90+
uses: actions/deploy-pages@v4

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
[![GitHub Action CI](https://github.com/jupyter-xeus/xeus-python/actions/workflows/main.yml/badge.svg)](https://github.com/jupyter-xeus/xeus-python/actions/workflows/main.yml)
44
[![Documentation Status](http://readthedocs.org/projects/xeus-python/badge/?version=latest)](https://xeus-python.readthedocs.io/en/latest/?badge=latest)
55
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/jupyter-xeus/xeus-python/stable?urlpath=/lab/tree/notebooks/xeus-python.ipynb)
6+
[![lite-badge](https://jupyterlite.rtfd.io/en/latest/_static/badge.svg)](https://jupyter-xeus.github.io/xeus-python/)
67
[![Zulip](https://img.shields.io/badge/social_chat-zulip-blue.svg)](https://jupyter.zulipchat.com)
78

89
`xeus-python` is a Jupyter kernel for Python based on the native implementation of the Jupyter protocol [xeus](https://github.com/jupyter-xeus/xeus).

environment-wasm-host.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ dependencies:
77
- pybind11 <3
88
- jedi
99
- nlohmann_json
10+
- nlohmann_json-abi
1011
- pybind11_json
1112
- numpy
1213
- xeus-lite

0 commit comments

Comments
 (0)