From 64d3aa31536838e84a4eb5c949251f04b492a6c1 Mon Sep 17 00:00:00 2001 From: DerThorsten Date: Wed, 2 Sep 2026 16:12:20 +0200 Subject: [PATCH 1/9] 6x --- .github/workflows/docs.yml | 4 ++-- .github/workflows/main.yml | 12 ++++++------ environment-dev.yml | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 3dc945a..d620987 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -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: diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fb46a16..a978eae 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -47,7 +47,7 @@ jobs: -c https://repo.prefix.dev/emscripten-forge-4x \ -c https://repo.mamba.pm/conda-forge \ --yes \ - "python=3.13" \ + "python=3.14" \ "pybind11<3" \ nlohmann_json pybind11_json numpy \ pytest bzip2 sqlite zlib zstd libffi \ @@ -86,7 +86,7 @@ jobs: -c https://repo.prefix.dev/emscripten-forge-4x \ -c https://repo.mamba.pm/conda-forge \ --yes \ - "python=3.13" pytest numpy exceptiongroup + "python=3.14" pytest numpy exceptiongroup - name: Test in browser-main @@ -96,7 +96,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 \ @@ -112,7 +112,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 \ @@ -127,7 +127,7 @@ jobs: -c https://repo.prefix.dev/emscripten-forge-4x \ -c https://repo.mamba.pm/conda-forge \ --yes \ - "python=3.13" pytest exceptiongroup + "python=3.14" pytest exceptiongroup - name: Test in browser-main-no-numpy run: | @@ -138,7 +138,7 @@ 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 \ diff --git a/environment-dev.yml b/environment-dev.yml index ef42e07..5ea2f07 100644 --- a/environment-dev.yml +++ b/environment-dev.yml @@ -1,7 +1,7 @@ name: pyjs-wasm channels: - conda-forge - - https://repo.prefix.dev/emscripten-forge-4x + - https://repo.prefix.dev/emscripte-forge-bot/emscripten-forge-6x dependencies: - cmake @@ -28,7 +28,7 @@ dependencies: - notebook >=7,<8 # to include the extension to switch between JupyterLab and Notebook # pyjs_code_runner dev deps - hatchling - - emscripten_emscripten-wasm32 == 4.0.9 + - emscripten_emscripten-wasm32 == 6.0.8 - pip: - JLDracula - pyjs_code_runner >= 3.0 From 420822e5a456a4a087a1485c8521005adf5b39d3 Mon Sep 17 00:00:00 2001 From: DerThorsten Date: Wed, 2 Sep 2026 16:15:36 +0200 Subject: [PATCH 2/9] 6x --- .github/workflows/main.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a978eae..64a515d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -44,15 +44,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.14" \ - "pybind11<3" \ - nlohmann_json pybind11_json numpy \ - pytest bzip2 sqlite zlib zstd libffi \ - exceptiongroup emscripten-abi>=4 \ - "openssl<4" liblzma + "libpython-python=3.14" \ + "pybind11" \ + "nlohmann_json" "pybind11_json" "numpy" \ + pytest \ + exceptiongroup emscripten-abi>=6 + mkdir build @@ -83,10 +83,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.prefix.dev/emscripten-forge-bot/emscripten-forge-6x \ -c https://repo.mamba.pm/conda-forge \ --yes \ - "python=3.14" pytest numpy exceptiongroup + "libpython-static=3.14" pytest numpy exceptiongroup - name: Test in browser-main @@ -124,10 +124,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.prefix.dev/emscripten-forge-bot/emscripten-forge-6x \ -c https://repo.mamba.pm/conda-forge \ --yes \ - "python=3.14" pytest exceptiongroup + "libpython-static=3.14" pytest exceptiongroup - name: Test in browser-main-no-numpy run: | From def38763f2f2b8ea3dd1075ee2112ea031caece9 Mon Sep 17 00:00:00 2001 From: DerThorsten Date: Wed, 2 Sep 2026 16:17:09 +0200 Subject: [PATCH 3/9] 6x --- .github/workflows/main.yml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 64a515d..387a8c6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -24,14 +24,17 @@ jobs: - 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 - environment-name: pyjs-wasm - condarc: | - channels: - - https://repo.prefix.dev/emscripten-forge-4x - - conda-forge + init-shell: >- + bash + powershell + environment-file: environment-dev.yml + environment-name: pyjs-wasm + condarc: | + channels: + - https://repo.prefix.dev/emscripten-forge-4x + - conda-forge - name: Install Playwright From cfbb5f389d723870f6d6f73e5e818a34580e6a40 Mon Sep 17 00:00:00 2001 From: DerThorsten Date: Wed, 2 Sep 2026 16:27:07 +0200 Subject: [PATCH 4/9] 6x --- .github/workflows/main.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 387a8c6..09280bd 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -26,15 +26,15 @@ jobs: - name: Install micromamba uses: mamba-org/setup-micromamba@v3 with: - init-shell: >- - bash - powershell - environment-file: environment-dev.yml - environment-name: pyjs-wasm - condarc: | - channels: - - https://repo.prefix.dev/emscripten-forge-4x - - conda-forge + init-shell: >- + bash + powershell + environment-file: environment-dev.yml + environment-name: pyjs-wasm + condarc: | + channels: + - https://repo.prefix.dev/emscripten-forge-4x + - conda-forge - name: Install Playwright From 1826288df04dc1e8d24656b8450d3e2639cb9d5d Mon Sep 17 00:00:00 2001 From: DerThorsten Date: Wed, 2 Sep 2026 16:54:34 +0200 Subject: [PATCH 5/9] 6x --- .github/workflows/main.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 09280bd..e9ccf8f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -28,12 +28,11 @@ jobs: with: init-shell: >- bash - powershell environment-file: environment-dev.yml environment-name: pyjs-wasm condarc: | channels: - - https://repo.prefix.dev/emscripten-forge-4x + - https://repo.prefix.dev/emscripten-forge-bot/emscripten-forge-6x - conda-forge From c06dc971661bbba5d378342f0138bf39f77ec1bb Mon Sep 17 00:00:00 2001 From: DerThorsten Date: Thu, 3 Sep 2026 09:31:55 +0200 Subject: [PATCH 6/9] fix --- environment-dev.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/environment-dev.yml b/environment-dev.yml index 5ea2f07..0c8ab3c 100644 --- a/environment-dev.yml +++ b/environment-dev.yml @@ -1,7 +1,7 @@ name: pyjs-wasm channels: - conda-forge - - https://repo.prefix.dev/emscripte-forge-bot/emscripten-forge-6x + - https://repo.prefix.dev/emscripten-forge-bot/emscripten-forge-6x dependencies: - cmake From ab6bce4eb4d1a822ba937e0f405dd01326bae622 Mon Sep 17 00:00:00 2001 From: DerThorsten Date: Thu, 3 Sep 2026 13:57:51 +0200 Subject: [PATCH 7/9] trigger --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e9ccf8f..920c752 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,7 +18,7 @@ jobs: runs-on: ubuntu-latest strategy: - fail-fast: false + fail-fast: true steps: - uses: actions/checkout@v2 @@ -49,7 +49,7 @@ jobs: -c https://repo.prefix.dev/emscripten-forge-bot/emscripten-forge-6x \ -c https://repo.mamba.pm/conda-forge \ --yes \ - "libpython-python=3.14" \ + "libpython-static=3.14" \ "pybind11" \ "nlohmann_json" "pybind11_json" "numpy" \ pytest \ From 1a909ea1f2dba3c8030dc14b75822ee97c94c856 Mon Sep 17 00:00:00 2001 From: DerThorsten Date: Fri, 4 Sep 2026 08:45:40 +0200 Subject: [PATCH 8/9] wip --- CMakeLists.txt | 8 ++- build_v2.sh | 139 +++++++++++++++++++++++++++++++++++++++++++ environment-dev.yml | 34 ----------- src/js_timestamp.cpp | 2 +- 4 files changed, 145 insertions(+), 38 deletions(-) create mode 100755 build_v2.sh delete mode 100644 environment-dev.yml diff --git a/CMakeLists.txt b/CMakeLists.txt index 56aa6b1..664b613 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,7 +11,7 @@ option(LINK_LIBLZMA "Link liblzma" OFF) # set PY_VERSION to 3.11 if the user has not set it if (NOT DEFINED PY_VERSION) - set(PY_VERSION 3.11) + set(PY_VERSION 3.14) endif() file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/pycpp_includes) @@ -148,9 +148,9 @@ target_include_directories(pyjs ) SET(PYTHON_UTIL_LIBS - ${CMAKE_INSTALL_PREFIX}/lib/libbz2.a + # ${CMAKE_INSTALL_PREFIX}/lib/libbz2.a ${CMAKE_INSTALL_PREFIX}/lib/libz.a - ${CMAKE_INSTALL_PREFIX}/lib/libsqlite3.a + # ${CMAKE_INSTALL_PREFIX}/lib/libsqlite3.a ${CMAKE_INSTALL_PREFIX}/lib/libffi.a ${CMAKE_INSTALL_PREFIX}/lib/libzstd.a # ssl @@ -159,6 +159,8 @@ SET(PYTHON_UTIL_LIBS ${CMAKE_INSTALL_PREFIX}/lib/libcrypto.a # lzma ${CMAKE_INSTALL_PREFIX}/lib/liblzma.a + + ${CMAKE_INSTALL_PREFIX}/lib/libpython${PY_VERSION}.a ) diff --git a/build_v2.sh b/build_v2.sh new file mode 100755 index 0000000..2d4202d --- /dev/null +++ b/build_v2.sh @@ -0,0 +1,139 @@ +#!/bin/bash +set -e + +# dir of this script +THIS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +BUILD_PREFIX_DIR=$THIS_DIR/build_prefix +WASM_PREFIX_DIR=$THIS_DIR/debug_prefix +WASM_DEPLOY_PREFIX_DIR=$THIS_DIR/deploy_prefix +EMSDK_DIR=$THIS_DIR/emsdk_install +EMSDK_ABI_VERSION=">=4" +DEPLOYMENT_DIR=$THIS_DIR/deploy + +mkdir -p $DEPLOYMENT_DIR + +MM=$MAMBA_EXE + + + +if false; then + rm -rf $BUILD_PREFIX_DIR + echo "Creating wasm env at $BUILD_PREFIX_DIR" + $MM create -p $BUILD_PREFIX_DIR \ + -f $THIS_DIR/environment-wasm-build.yml \ + --yes + exit 0 +fi + +if false; then + rm -rf $WASM_PREFIX_DIR + echo "Creating wasm env at $WASM_PREFIX_DIR" + $MM create -p $WASM_PREFIX_DIR \ + --platform=emscripten-wasm32 \ + -f $THIS_DIR/environment-wasm.yml \ + --yes + +fi + +export PY_VER=3.14 + +if true; then + echo "Building pyjs" + + rm -rf build + mkdir -p build + cd build + + export PREFIX=$WASM_PREFIX_DIR + export CMAKE_PREFIX_PATH=$PREFIX + export CMAKE_SYSTEM_PREFIX_PATH=$PREFIX + emcmake cmake \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ON \ + -DBUILD_RUNTIME_BROWSER=ON \ + -DBUILD_RUNTIME_NODE=OFF \ + -DCMAKE_INSTALL_PREFIX=$PREFIX \ + -DLINK_LIBLZMA=ON \ + -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=$BUILD_PREFIX/bin/python${PY_VER} \ + -DPYTHON_MODULE_EXTENSION=.so \ + -DPYTHON_MODULE_DEBUG_POSTFIX="" \ + -DPYTHON_MODULE_EXT_SUFFIX=.so \ + -DPython_FOUND=TRUE \ + .. + + emmake make -j8 + emmake make install +fi + + +DEPLOYMENT_DIR=$THIS_DIR/deploy +mkdir -p $DEPLOYMENT_DIR + +# pack env with empack +if false; then + + cd $THIS_DIR + + + echo "Packing wasm env" + rm -rf $DEPLOYMENT_DIR/pyjs-wasm-env.tar.zst + + + empack pack env \ + --env-prefix $WASM_DEPLOY_PREFIX_DIR \ + --relocate-prefix "/" \ + --no-use-cache \ + --outdir $DEPLOYMENT_DIR + + echo "pack pyjs module" + empack pack dir \ + --host-dir $THIS_DIR/module/pyjs \ + --mount-dir /lib/python3.13/site-packages/pyjs \ + --outname "pyjsmod.tar.gz" \ + --outdir $DEPLOYMENT_DIR + + empack pack append \ + --env-meta $DEPLOYMENT_DIR/empack_env_meta.json \ + --tarfile $DEPLOYMENT_DIR/pyjsmod.tar.gz + +fi + +# copy pyjs binary to deployment dir +cp $THIS_DIR/build/pyjs_runtime_browser.js $DEPLOYMENT_DIR/pyjs_runtime_browser.js +cp $THIS_DIR/build/pyjs_runtime_browser.wasm $DEPLOYMENT_DIR/pyjs_runtime_browser.wasm +# cp $THIS_DIR/index.html $DEPLOYMENT_DIR/index.html + +if false; then + mkdir -p $THIS_DIR/build/host_work_dir + cd $THIS_DIR + BUILD_DIR=$THIS_DIR/build + + # run in env with does not contain numpy + pyjs_code_runner run script \ + browser-main \ + --conda-env $WASM_DEPLOY_PREFIX_DIR \ + --mount $THIS_DIR/tests:/tests \ + --mount $THIS_DIR/module/pyjs:/lib/python3.13/site-packages/pyjs \ + --script main.py \ + --work-dir /tests \ + --host-work-dir $BUILD_DIR/host_work_dir \ + --headless \ + --no-cache \ + --slow-mo 0 \ + --async-main \ + --pyjs-dir $BUILD_DIR \ + +fi + + + +# rm -rf deploy +# mkdir -p deploy +# cd deploy + +# jupyter lite build --XeusAddon.prefix=$WASM_PREFIX_DIR \ No newline at end of file diff --git a/environment-dev.yml b/environment-dev.yml deleted file mode 100644 index 0c8ab3c..0000000 --- a/environment-dev.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: pyjs-wasm -channels: - - conda-forge - - https://repo.prefix.dev/emscripten-forge-bot/emscripten-forge-6x - -dependencies: - - cmake - - pip - - python - - yarn - - click - - microsoft::playwright <= 1.50 - - ninja - - nodejs - - pyjs_code_runner >= 2.0.1 - - exceptiongroup - # documentation - - jupytext - - mkdocs - - mkdocstrings - - mkdocstrings-python - - mkdocs-material - - empack >=6.0.0 - - jupyter_server # to enable contents - - jupyterlite - - jupyterlite-xeus >= 3.1.8 - - jupyterlite-sphinx - - notebook >=7,<8 # to include the extension to switch between JupyterLab and Notebook - # pyjs_code_runner dev deps - - hatchling - - emscripten_emscripten-wasm32 == 6.0.8 - - pip: - - JLDracula - - pyjs_code_runner >= 3.0 diff --git a/src/js_timestamp.cpp b/src/js_timestamp.cpp index 6c1742d..b30456f 100644 --- a/src/js_timestamp.cpp +++ b/src/js_timestamp.cpp @@ -1 +1 @@ -#define PYJS_JS_UTC_TIMESTAMP "2025-10-07 09:33:27.627626" \ No newline at end of file +#define PYJS_JS_UTC_TIMESTAMP "2026-09-03 14:23:48.492790" \ No newline at end of file From 9311d50476e3dec91c9c9ee3df9a5087f6828134 Mon Sep 17 00:00:00 2001 From: DerThorsten Date: Fri, 4 Sep 2026 08:48:12 +0200 Subject: [PATCH 9/9] wip --- environment-wasm-build.yml | 34 ++++++++++++++++++++++++++++++++++ environment-wasm.yml | 11 +++++++++++ 2 files changed, 45 insertions(+) create mode 100644 environment-wasm-build.yml create mode 100644 environment-wasm.yml diff --git a/environment-wasm-build.yml b/environment-wasm-build.yml new file mode 100644 index 0000000..74050c5 --- /dev/null +++ b/environment-wasm-build.yml @@ -0,0 +1,34 @@ +name: pyjs-wasm-build +channels: + - conda-forge + - https://repo.prefix.dev/emscripten-forge-bot/emscripten-forge-6x + +dependencies: + - cmake + - pip + - python + - yarn + - click + - ninja + - nodejs + - emscripten_emscripten-wasm32 == 6.0.8 + # - microsoft::playwright <= 1.50 + # - pyjs_code_runner >= 2.0.1 + # - exceptiongroup + # # documentation + # - jupytext + # - mkdocs + # - mkdocstrings + # - mkdocstrings-python + # - mkdocs-material + # - empack >=6.0.0 + # - jupyter_server # to enable contents + # - jupyterlite + # - jupyterlite-xeus >= 3.1.8 + # - jupyterlite-sphinx + # - notebook >=7,<8 # to include the extension to switch between JupyterLab and Notebook + # # pyjs_code_runner dev deps + # - hatchling + # - pip: + # - JLDracula + # - pyjs_code_runner >= 3.0 diff --git a/environment-wasm.yml b/environment-wasm.yml new file mode 100644 index 0000000..a2b5885 --- /dev/null +++ b/environment-wasm.yml @@ -0,0 +1,11 @@ +name: pyjs-wasm-run +channels: + - conda-forge + - https://repo.prefix.dev/emscripten-forge-bot/emscripten-forge-6x + +dependencies: + - python-dev + - pybind11 + - emscripten-abi==6.0.8 + - numpy + - zlib-static \ No newline at end of file