Skip to content

4.0.0: run on the pyjs npm package's JavaScript (pyjs >= 6); pixi - #20

Merged
DerThorsten merged 3 commits into
emscripten-forge:mainfrom
DerThorsten:new_pyjs
Nov 27, 2026
Merged

DerThorsten merged 3 commits into
emscripten-forge:mainfrom
DerThorsten:new_pyjs

Conversation

@DerThorsten

Copy link
Copy Markdown
Collaborator

pyjs >= 6 (the classic init API the runner used is gone since pyjs 5.2): the runner drives pyjs through the JavaScript of the pyjs npm package (initializePyjsRuntime), with the same CLI / run(...) surface, so pytester keeps working.

  • --conda-env: an emscripten-forge env with pyjs >= 6; its runtime + the npm JavaScript (lib_js/pyjs/npm, shipped by the pyjs conda package) are used, the env is packed with empack
  • --pyjs-npm <spec | dir | .tgz>: an npm package with its own runtime and env, extra conda packages via --package
  • one playwright backend (main thread / worker); the node backend and appdirs are gone; uncaught errors / unhandled rejections in the page end the run

pixi replaces dev-env.yml / dev-env-pip.yml: pixi run test [browsers] (local == CI, setup-pixi, one job per browser). playwright and playwright-python are pinned to the same minor version (a mismatch fails every launch).

Tested locally with a local pyjs 6 recipe build (PYJS_CODE_RUNNER_TEST_CHANNEL): chromium, firefox, webkit, main + worker, all pass.

Draft until pyjs-dev 6 is on the emscripten-forge 6x channel (the tests install it). The recipes pin pytester to pyjs_code_runner 3.2.* (emscripten-forge/recipes#8721), so releasing 4.0.0 does not affect recipe tests until the pin is bumped.

🤖 Generated with Claude Code

DerThorsten and others added 3 commits November 25, 2026 14:57
The runner broke with pyjs 5.2 (the classic init API it used is gone). It now
drives pyjs through the npm package's JavaScript (`initializePyjsRuntime`),
with the same surface API (`pyjs_code_runner run script ...`, `run(...)`), so
pytester keeps working unchanged.

Where pyjs and python come from:
- `--conda-env`: an emscripten-forge env with pyjs >= 6. Its runtime and the
  npm JavaScript (lib_js/pyjs/npm, shipped by the pyjs conda package) are
  used and the env is packed with empack: exactly what is installed runs,
  e.g. a python, pyjs and package that were just built locally.
- `--pyjs-npm <spec | dir | .tgz>`: the npm package with its own runtime and
  environment; extra conda packages via `--package` (repeatable), `--arch`.

Simplified: one browser backend (playwright, main thread or worker, stdlib
http server; web/index.html, worker.js, run.js) instead of the per-backend
html / js / servers; the node backend and appdirs are gone. Uncaught errors
and unhandled rejections in the page end the run instead of hanging.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pixi.toml / pixi.lock replace dev-env.yml / dev-env-pip.yml:
`pixi run test [browsers]` installs the playwright browsers and runs the
tests; the CI runs the same task (one job per browser, setup-pixi).
playwright (node driver) and playwright-python are pinned to the same
minor version: a mismatch fails every browser launch ("timeout: expected
float, got undefined"). The tests create their emscripten env with the
micromamba of the pixi env (or $MAMBA_EXE).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…st-conda

The CI runs the npm mode (pixi run test, @derthorsten/pyjs@6.0.1,
PYJS_CODE_RUNNER_TEST_NPM): pyjs-dev >= 6 is not on the emscripten-forge
channel yet. The conda mode (pixi run test-conda, an emscripten-forge env
with pyjs-dev >= 6, e.g. a local recipe build) runs locally.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@DerThorsten
DerThorsten marked this pull request as ready for review November 27, 2026 09:48
@DerThorsten
DerThorsten merged commit c32fb5d into emscripten-forge:main Nov 27, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant