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
19 changes: 12 additions & 7 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,34 +20,39 @@ jobs:
strategy:
fail-fast: false
matrix:
emsdk_ver: ["3.1.58"]
include:
- emsdk_ver: "3.1.45"
python_version: "3.11"


steps:
- uses: actions/checkout@v2

- name: Get number of CPU cores
uses: SimenB/github-actions-cpu-cores@v1


- name: Install micromamba
uses: mamba-org/setup-micromamba@v1
with:
environment-file: environment-dev.yml
environment-file: environment-dev_${{matrix.emsdk_ver}}.yml
environment-name: pyjs-wasm

condarc: |
channels:
- https://repo.mamba.pm/emscripten-forge
- conda-forge

- name: build the docs
shell: bash -el {0}
run: |
./build_mkdocs.sh
./build_mkdocs.sh ${{matrix.emsdk_ver}} ${{ matrix.python_version }}


################################################################
# upload to github pages
################################################################
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v2
with:
path: docs_build/mkdocs
path: docs_build/mkdocs


deploy:
Expand Down
32 changes: 18 additions & 14 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,40 +20,44 @@ jobs:
strategy:
fail-fast: false
matrix:
emsdk_ver: ["3.1.58"]
include:
- emsdk_ver: "3.1.45"
python_version: "3.11"
pybind11_version: "<2.12.0"
# - emsdk_ver: "3.1.58"
# python_version: "3.12"
# pybind11_version: ""

steps:
- uses: actions/checkout@v2

- name: Install micromamba
uses: mamba-org/setup-micromamba@v1
with:
environment-file: environment-dev.yml
environment-file: environment-dev_${{matrix.emsdk_ver}}.yml
environment-name: pyjs-wasm


condarc: |
channels:
- https://repo.mamba.pm/emscripten-forge
- conda-forge

- name: Install Playwright
run: |
playwright install

- name: Setup emsdk
shell: bash -el {0}
run: |
./emsdk/setup_emsdk.sh ${{ matrix.emsdk_ver }} $(pwd)/emsdk_install

- name: Build pyjs
run: |
micromamba activate pyjs-wasm

emsdk activate ${{matrix.emsdk_ver}}
source $(pwd)/emsdk_install/emsdk_env.sh
# emsdk activate ${{matrix.emsdk_ver}}
# source $(pwd)/emsdk_install/emsdk_env.sh

micromamba create -n pyjs-build-wasm \
--platform=emscripten-wasm32 \
-c https://repo.mamba.pm/emscripten-forge \
-c https://repo.mamba.pm/conda-forge \
--yes \
python pybind11 nlohmann_json pybind11_json numpy "pytest==7.1.1" bzip2 sqlite zlib zstd libffi exceptiongroup
python=${{matrix.python_version}} "pybind11${{matrix.pybind11_version}}" nlohmann_json pybind11_json "numpy<2" "pytest==7.1.1" bzip2 sqlite zlib zstd libffi exceptiongroup emscripten-abi==${{matrix.emsdk_ver}}


mkdir build
Expand Down Expand Up @@ -87,7 +91,7 @@ jobs:
-c https://repo.mamba.pm/emscripten-forge \
-c https://repo.mamba.pm/conda-forge \
--yes \
python "pytest==7.1.1" numpy exceptiongroup
"python=${{matrix.python_version}}" "pytest==7.1.1" "numpy<2" exceptiongroup


- name: Test in browser-main
Expand Down Expand Up @@ -128,7 +132,7 @@ jobs:
-c https://repo.mamba.pm/emscripten-forge \
-c https://repo.mamba.pm/conda-forge \
--yes \
python "pytest==7.1.1" exceptiongroup
"python=${{matrix.python_version}}" "pytest==7.1.1" exceptiongroup

- name: Test in browser-main-no-numpy
run: |
Expand Down
35 changes: 16 additions & 19 deletions build_mkdocs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,12 @@ set -e
THIS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
WASM_ENV_NAME=pyjs-wasm-dev
WASM_ENV_PREFIX=$MAMBA_ROOT_PREFIX/envs/$WASM_ENV_NAME
EMSDK_DIR=$THIS_DIR/emsdk_install
EMSDK_VERSION="3.1.58"
EMSDK_DIR=$WASM_ENV_PREFIX/opt/emsdk
EMSDK_VERSION=$1
PYTHON_VERSION=$2




if [ ! -d "$EMSDK_DIR" ]; then
echo "Creating emsdk dir $EMSDK_DIR"
$THIS_DIR/emsdk/setup_emsdk.sh $EMSDK_VERSION $EMSDK_DIR
else
echo "Emsdk dir $EMSDK_DIR already exists"
fi


PYJS_PROBE_FILE=$WASM_ENV_PREFIX/lib_js/pyjs/pyjs_runtime_browser.js

Expand All @@ -27,9 +21,9 @@ if [ ! -d "$WASM_ENV_PREFIX" ]; then
-c https://repo.mamba.pm/emscripten-forge \
-c https://repo.mamba.pm/conda-forge \
--yes \
python pybind11 nlohmann_json pybind11_json numpy \
bzip2 sqlite zlib zstd libffi exceptiongroup \
"xeus<4" "xeus-lite<2" xeus-python "xeus-javascript>=0.3.2" xtl "ipython=8.22.2=py311had7285e_1" "traitlets>=5.14.2"
python=$PYTHON_VERSION "pybind11" nlohmann_json pybind11_json numpy \
bzip2 sqlite zlib zstd libffi exceptiongroup\
"xeus" "xeus-lite" xeus-python "xeus-javascript" xtl "ipython=8.22.2=py311had7285e_1" "traitlets>=5.14.2"

else
echo "Wasm env $WASM_ENV_NAME already exists"
Expand All @@ -42,8 +36,7 @@ if true; then
echo "Building pyjs"

cd $THIS_DIR
source $EMSDK_DIR/emsdk_env.sh


mkdir -p build
cd build

Expand All @@ -69,7 +62,7 @@ fi
# if there is no xeus-python dir, clone it
if [ ! -d "$THIS_DIR/xeus-python" ]; then
cd $THIS_DIR
git clone -b pyjs_update https://github.com/DerThorsten/xeus-python/
git clone https://github.com/jupyter-xeus/xeus-python/
else
echo "xeus-python dir already exists"
fi
Expand All @@ -81,7 +74,7 @@ if true; then
echo "Building xeus-python"

cd $THIS_DIR
source $EMSDK_DIR/emsdk_env.sh
# source $EMSDK_DIR/emsdk_env.sh


cd xeus-python
Expand All @@ -98,11 +91,15 @@ if true; then
cd build_wasm


# # this is stupid
# cp -r $WASM_ENV_PREFIX/include/python3.11/ $WASM_ENV_PREFIX/include/

emcmake cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ON \
-DCMAKE_INSTALL_PREFIX=$PREFIX \
-DXPYT_EMSCRIPTEN_WASM_BUILD=ON\
-DXPYT_EMSCRIPTEN_WASM_BUILD=ON \
-DCMAKE_INCLUDE_PATH=$WASM_ENV_PREFIX/include/python3.11


emmake make -j8 install
Expand All @@ -119,7 +116,7 @@ if false; then
echo "Building xeus-javascript"

cd $THIS_DIR
source $EMSDK_DIR/emsdk_env.sh
# source $EMSDK_DIR/emsdk_env.sh


cd ~/src/xeus-javascript
Expand Down

This file was deleted.

This file was deleted.

87 changes: 0 additions & 87 deletions emsdk/patches/0003-Changes-for-JSPI.patch

This file was deleted.

Loading
Loading