Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 88 additions & 0 deletions .github/workflows/deploy-github-page.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: build and deploy

on:
workflow_dispatch:
pull_request:
push:
branches:
- main

permissions:
contents: read
pages: write
id-token: write

jobs:
build:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
include:
- name: Github-page

steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0

- name: Install mamba
uses: mamba-org/setup-micromamba@v2
with:
environment-file: environment-wasm-build.yml
init-shell: bash
environment-name: xeus-python-wasm-build

- name: Set ncpus
run: echo "ncpus=$(nproc --all)" >> $GITHUB_ENV

- name: Build xeus-python
shell: bash -l {0}
run: |
micromamba create -f environment-wasm-host.yml --platform=emscripten-wasm32

set -eux

export PREFIX=$MAMBA_ROOT_PREFIX/envs/xeus-python-wasm-host
echo "PREFIX=$PREFIX" >> $GITHUB_ENV

emcmake cmake . \
-DCMAKE_PREFIX_PATH=$PREFIX \
-DCMAKE_INSTALL_PREFIX=$PREFIX \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ON \
-DXPYT_EMSCRIPTEN_WASM_BUILD=ON \
-DCMAKE_VERBOSE_MAKEFILE=ON

emmake make -j${{ env.ncpus }} install

- name: Jupyter Lite integration
shell: bash -l {0}
run: |
jupyter lite build \
--XeusAddon.prefix=${{ env.PREFIX }} \
--contents notebooks/xeus-python.ipynb \
--output-dir dist

- name: Upload artifact
uses: actions/upload-pages-artifact@v4
with:
path: ./dist

deploy:
needs: build
if: github.ref == 'refs/heads/main'
permissions:
pages: write
id-token: write

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
44 changes: 2 additions & 42 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
build_type: [static_build, shared_build]

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- name: Install micromamba
uses: mamba-org/setup-micromamba@v2
Expand Down Expand Up @@ -87,7 +87,7 @@ jobs:
build_type: [static_build, shared_build]

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- name: Install micromamba
uses: mamba-org/setup-micromamba@v2
Expand Down Expand Up @@ -144,43 +144,3 @@ jobs:
timeout-minutes: 4
working-directory: build\test

test-wasm:

runs-on: ubuntu-latest

strategy:
fail-fast: false

steps:
- uses: actions/checkout@v4

- name: install mamba
uses: mamba-org/setup-micromamba@main
with:
environment-file: environment-wasm-build.yml
init-shell: bash

- name: Build and pack xeus-python
shell: bash -l {0}
run: |
micromamba create -f environment-wasm-host.yml --platform=emscripten-wasm32

mkdir build
pushd build

export PREFIX=$MAMBA_ROOT_PREFIX/envs/xeus-python-wasm-host
export CMAKE_PREFIX_PATH=$PREFIX
export CMAKE_SYSTEM_PREFIX_PATH=$PREFIX

# remove all the fake pythons binaries
rm -f $PREFIX/bin/python*

emcmake cmake \
-DCMAKE_PREFIX_PATH=$PREFIX \
-DCMAKE_INSTALL_PREFIX=$PREFIX \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ON \
-DXPYT_EMSCRIPTEN_WASM_BUILD=ON \
..

make -j4
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
[![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)
[![Documentation Status](http://readthedocs.org/projects/xeus-python/badge/?version=latest)](https://xeus-python.readthedocs.io/en/latest/?badge=latest)
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/jupyter-xeus/xeus-python/stable?urlpath=/lab/tree/notebooks/xeus-python.ipynb)
[![lite-badge](https://jupyterlite.rtfd.io/en/latest/_static/badge.svg)](https://jupyter-xeus.github.io/xeus-python/)
[![Zulip](https://img.shields.io/badge/social_chat-zulip-blue.svg)](https://jupyter.zulipchat.com)

`xeus-python` is a Jupyter kernel for Python based on the native implementation of the Jupyter protocol [xeus](https://github.com/jupyter-xeus/xeus).
Expand Down
4 changes: 4 additions & 0 deletions environment-wasm-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ dependencies:
- python=3.13
- yarn
- click
# JupyterLite
- jupyterlite-core
- jupyter_server
- jupyterlite-xeus
1 change: 1 addition & 0 deletions environment-wasm-host.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ dependencies:
- pybind11 <3
- jedi
- nlohmann_json
- nlohmann_json-abi
- pybind11_json
- numpy
- xeus-lite
Expand Down