Skip to content
Open
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
52 changes: 0 additions & 52 deletions .clang-format

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ jobs:
fail-fast: false
matrix:
include:
- emsdk_ver: "3.1.73"
python_version: "3.13"
- emsdk_ver: "6.0.8"
python_version: "3.14"


steps:
Expand Down
220 changes: 191 additions & 29 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,28 @@ defaults:

jobs:

test-browser:
test-browser-wasm32:

runs-on: ubuntu-latest

strategy:
fail-fast: false
fail-fast: true

steps:
- uses: actions/checkout@v2

- name: Install micromamba
uses: mamba-org/setup-micromamba@v1
uses: mamba-org/setup-micromamba@v3
with:
environment-file: environment-dev.yml
init-shell: >-
bash
environment-file: environment-wasm-build-wasm32.yml
environment-name: pyjs-wasm
condarc: |
channels:
- https://repo.prefix.dev/emscripten-forge-4x
- microsoft
- conda-forge
- https://repo.prefix.dev/emscripten-forge-bot/emscripten-forge-6x


- name: Install Playwright
Expand All @@ -44,15 +47,15 @@ jobs:

micromamba create -n pyjs-build-wasm \
--platform=emscripten-wasm32 \
-c https://repo.prefix.dev/emscripten-forge-4x \
-c https://repo.prefix.dev/emscripten-forge-bot/emscripten-forge-6x \
-c https://repo.mamba.pm/conda-forge \
--yes \
"python=3.13" \
"pybind11<3" \
nlohmann_json pybind11_json numpy \
pytest bzip2 sqlite zlib zstd libffi \
exceptiongroup emscripten-abi>=4 \
"openssl<4" liblzma
"python-dev=3.14" \
"pybind11" \
"nlohmann_json" "pybind11_json" "numpy" \
pytest \
exceptiongroup emscripten-abi>=6



mkdir build
Expand All @@ -62,15 +65,27 @@ jobs:
export PREFIX=$MAMBA_ROOT_PREFIX/envs/pyjs-build-wasm
export CMAKE_PREFIX_PATH=$PREFIX
export CMAKE_SYSTEM_PREFIX_PATH=$PREFIX

export PY_VER=3.14
# build pyjs
emcmake cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ON \
-DBUILD_RUNTIME_BROWSER=ON \
-DBUILD_RUNTIME_NODE=OFF \
-DCMAKE_INSTALL_PREFIX=$PREFIX \
..
-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ON \
-DBUILD_RUNTIME_BROWSER=ON \
-DBUILD_RUNTIME_NODE=OFF \
-DCMAKE_INSTALL_PREFIX=$PREFIX \
-DLINK_LIBLZMA=ON \
-DPY_VERSION=$PY_VER \
-DPYTHON_SITE_PACKAGES=$PREFIX/lib/python${PY_VER}/site-packages \
-DPython_INCLUDE_DIRS=$PREFIX/include/python${PY_VER} \
-DPython_LIBRARY=$PREFIX/lib/libpython${PY_VER}.a \
-DPython_LIBRARIES=$PREFIX/lib/libpython${PY_VER}.a \
-DPython_Interpreter_FOUND=TRUE \
-DPython_EXECUTABLE=$MAMBA_ROOT_PREFIX/envs/pyjs-wasm/bin/python${PY_VER} \
-DPYTHON_MODULE_EXTENSION=.so \
-DPYTHON_MODULE_DEBUG_POSTFIX="" \
-DPYTHON_MODULE_EXT_SUFFIX=.so \
-DPython_FOUND=TRUE \
-DWASM64=FALSE \
..

make -j2

Expand All @@ -83,10 +98,10 @@ jobs:
micromamba activate pyjs-wasm
micromamba create -n pyjs-build-wasm-with-numpy \
--platform=emscripten-wasm32 \
-c https://repo.prefix.dev/emscripten-forge-4x \
-c https://repo.mamba.pm/conda-forge \
-c https://repo.prefix.dev/emscripten-forge-bot/emscripten-forge-6x \
-c https://repo.prefix.dev/conda-forge \
--yes \
"python=3.13" pytest numpy exceptiongroup
"python=3.14" "pytest>=9" numpy


- name: Test in browser-main
Expand All @@ -96,7 +111,7 @@ jobs:
browser-main \
--conda-env $MAMBA_ROOT_PREFIX/envs/pyjs-build-wasm-with-numpy \
--mount $(pwd)/tests:/tests \
--mount $(pwd)/module/pyjs:/lib/python3.13/site-packages/pyjs \
--mount $(pwd)/module/pyjs:/lib/python3.14/site-packages/pyjs \
--script main.py \
--work-dir /tests \
--pyjs-dir $(pwd)/build \
Expand All @@ -112,7 +127,7 @@ jobs:
browser-worker \
--conda-env $MAMBA_ROOT_PREFIX/envs/pyjs-build-wasm-with-numpy \
--mount $(pwd)/tests:/tests \
--mount $(pwd)/module/pyjs:/lib/python3.13/site-packages/pyjs \
--mount $(pwd)/module/pyjs:/lib/python3.14/site-packages/pyjs \
--script main.py \
--work-dir /tests \
--pyjs-dir $(pwd)/build \
Expand All @@ -124,10 +139,10 @@ jobs:
micromamba activate pyjs-wasm
micromamba create -n pyjs-build-wasm-no-numpy \
--platform=emscripten-wasm32 \
-c https://repo.prefix.dev/emscripten-forge-4x \
-c https://repo.mamba.pm/conda-forge \
-c https://repo.prefix.dev/emscripten-forge-bot/emscripten-forge-6x \
-c https://repo.prefix.dev/conda-forge \
--yes \
"python=3.13" pytest exceptiongroup
"python=3.14" "pytest>=9"

- name: Test in browser-main-no-numpy
run: |
Expand All @@ -138,10 +153,157 @@ jobs:
browser-main \
--conda-env $MAMBA_ROOT_PREFIX/envs/pyjs-build-wasm-no-numpy \
--mount $(pwd)/tests:/tests \
--mount $(pwd)/module/pyjs:/lib/python3.13/site-packages/pyjs \
--mount $(pwd)/module/pyjs:/lib/python3.14/site-packages/pyjs \
--script main.py \
--work-dir /tests \
--pyjs-dir $(pwd)/build \
--headless \
--async-main \
--no-cache
--no-cache
test-browser-wasm64:

runs-on: ubuntu-latest

strategy:
fail-fast: true

steps:
- uses: actions/checkout@v2

- name: Install micromamba
uses: mamba-org/setup-micromamba@v3
with:
init-shell: >-
bash
environment-file: environment-wasm-build-wasm64.yml
environment-name: pyjs-wasm
condarc: |
channels:
- microsoft
- conda-forge
- https://repo.prefix.dev/emscripten-forge-bot/emscripten-forge-6x


- name: Install Playwright
run: |
playwright install

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

micromamba create -n pyjs-build-wasm64 \
--platform=emscripten-wasm64 \
-c https://repo.prefix.dev/emscripten-forge-bot/emscripten-forge-6x \
-c https://repo.mamba.pm/conda-forge \
--yes \
"python-dev=3.14" \
"pybind11" \
"nlohmann_json" "pybind11_json" "numpy" \
pytest \
exceptiongroup emscripten-abi>=6



mkdir build
pushd build


export PREFIX=$MAMBA_ROOT_PREFIX/envs/pyjs-build-wasm64
export CMAKE_PREFIX_PATH=$PREFIX
export CMAKE_SYSTEM_PREFIX_PATH=$PREFIX
export PY_VER=3.14
# build pyjs
emcmake cmake \
-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ON \
-DBUILD_RUNTIME_BROWSER=ON \
-DBUILD_RUNTIME_NODE=OFF \
-DCMAKE_INSTALL_PREFIX=$PREFIX \
-DLINK_LIBLZMA=ON \
-DPY_VERSION=$PY_VER \
-DPYTHON_SITE_PACKAGES=$PREFIX/lib/python${PY_VER}/site-packages \
-DPython_INCLUDE_DIRS=$PREFIX/include/python${PY_VER} \
-DPython_LIBRARY=$PREFIX/lib/libpython${PY_VER}.a \
-DPython_LIBRARIES=$PREFIX/lib/libpython${PY_VER}.a \
-DPython_Interpreter_FOUND=TRUE \
-DPython_EXECUTABLE=$MAMBA_ROOT_PREFIX/envs/pyjs-wasm/bin/python${PY_VER} \
-DPYTHON_MODULE_EXTENSION=.so \
-DPYTHON_MODULE_DEBUG_POSTFIX="" \
-DPYTHON_MODULE_EXT_SUFFIX=.so \
-DPython_FOUND=TRUE \
-DWASM64=TRUE \
..

make -j2

make install

popd

- name: setup env with numpy
run: |
micromamba activate pyjs-wasm
micromamba create -n pyjs-build-wasm-with-numpy \
--platform=emscripten-wasm64 \
-c https://repo.prefix.dev/emscripten-forge-bot/emscripten-forge-6x \
-c https://repo.prefix.dev/conda-forge \
--yes \
"python=3.14" "pytest>=9" numpy


- name: Test in browser-main
run: |
micromamba activate pyjs-wasm
pyjs_code_runner run script \
browser-main \
--conda-env $MAMBA_ROOT_PREFIX/envs/pyjs-build-wasm-with-numpy \
--mount $(pwd)/tests:/tests \
--mount $(pwd)/module/pyjs:/lib/python3.14/site-packages/pyjs \
--script main.py \
--work-dir /tests \
--pyjs-dir $(pwd)/build \
--headless \
--async-main

- name: Test in browser-worker
run: |
micromamba activate pyjs-wasm


pyjs_code_runner run script \
browser-worker \
--conda-env $MAMBA_ROOT_PREFIX/envs/pyjs-build-wasm-with-numpy \
--mount $(pwd)/tests:/tests \
--mount $(pwd)/module/pyjs:/lib/python3.14/site-packages/pyjs \
--script main.py \
--work-dir /tests \
--pyjs-dir $(pwd)/build \
--headless \
--async-main

- name: setup minimal env without numpy
run: |
micromamba activate pyjs-wasm
micromamba create -n pyjs-build-wasm-no-numpy \
--platform=emscripten-wasm64 \
-c https://repo.prefix.dev/emscripten-forge-bot/emscripten-forge-6x \
-c https://repo.prefix.dev/conda-forge \
--yes \
"python=3.14" "pytest>=9"

- name: Test in browser-main-no-numpy
run: |
micromamba activate pyjs-wasm


pyjs_code_runner run script \
browser-main \
--conda-env $MAMBA_ROOT_PREFIX/envs/pyjs-build-wasm-no-numpy \
--mount $(pwd)/tests:/tests \
--mount $(pwd)/module/pyjs:/lib/python3.14/site-packages/pyjs \
--script main.py \
--work-dir /tests \
--pyjs-dir $(pwd)/build \
--headless \
--async-main \
--no-cache
Loading
Loading