Skip to content

feat: upgrade Pyodide from 0.27.7 to 0.29.5 - #265

Closed
schloerke wants to merge 3 commits into
mainfrom
schloerke/pyodide-0.29.5
Closed

schloerke wants to merge 3 commits into
mainfrom
schloerke/pyodide-0.29.5

Conversation

@schloerke

Copy link
Copy Markdown
Collaborator

Upgrades the bundled Pyodide from 0.27.7 to 0.29.5 (Python 3.12 → 3.13), and bumps shinychat from 0.6.1 to 0.7.2, which needs the newer pydantic. Part of posit-dev/shinylive#254.

Important

Blocked on the libsass wheel. CI downloads libsass-0.23.0-cp313-abi3-pyemscripten_2025_0_wasm32.whl from pkg.garrickadenbuie.com, which only has the old pyodide_2024_0 build, so make all fails until the new wheel is published there. I built it locally from gadenbuie/libsass-python dev with pyodide-build 0.39.3 and the 0.29.5 cross-build env, and all the tests here ran against that build. To publish it, gadenbuie/libsass-python's pyodide.yml needs the 0.29.5 / Python 3.13 / Emscripten 4.0.9 versions, and keep_files: true on the gh-pages deploy. Without that, the deploy removes the old wheel that main still downloads.

What changed for 0.29.5

  • toJs() returns plain objects. From Pyodide 0.29, a Python dict converts to a plain JS object, not a Map. Object.fromEntries(event.toJs()) in messageporthttp.ts and messageportwebsocket-channel.ts would throw on every HTTP response and websocket message. Both now pass dict_converter: Object.fromEntries, as pyodide-proxy.ts already does.
  • libsass wheel. Rebuilt for Python 3.13 and the pyemscripten_2025_0 platform tag. Pyodide's own wheels use the same tag.
  • joblib warning. Pyodide 0.29's joblib warns on import that it "will operate in serial mode", which broke the Regularization example. Shinylive now sets JOBLIB_MULTIPROCESSING=0, so joblib doesn't try to use multiprocessing.
  • orig_pyodide_lock(). Pyodide 0.28 dropped info.version from pyodide-lock.json, so the check that noticed a newly unpacked Pyodide always saw None == None. It now treats a pyodide-lock.json without shiny in it as fresh.
  • create_typeshed.py targets Python 3.13. src/pyodide/ is recopied from the 0.29.5 dist by make pyodide_js.

shinychat 0.6.1 → 0.7.2

Pyodide 0.29.5 ships pydantic 2.12.5, which meets shinychat 0.7's pydantic>=2.11. The lock entry was edited by hand with _get_pypi_package_info, because full lock regeneration is still broken (posit-dev/shinylive#233). orjson comes from Pyodide and moves from 3.10.1 to 3.10.16, which meets shiny's orjson>=3.10.7.

Test server

Pyodide fetches all of an app's wheels at once, about 40 for a Shiny app. python -m http.server queues only 5 pending connections, and on macOS it resets the rest. Pyodide skips any package it couldn't fetch, so apps randomly failed with No module named 'anyio' (or htmltools). The tests now serve with tests/static_server.py, a ThreadingHTTPServer with a queue of 128. The export server uses it too.

Not in this PR

  • Pyodide 0.29 now ships starlette 0.47.2, platformdirs, altair 6.0 and narwhals itself. shinylive_lock.json still pins its own versions (starlette 0.38.1, for example), and those override Pyodide's, as they did for anyio and sniffio before. Moving to Pyodide's versions belongs with the lock regeneration in posit-dev/shinylive#233.
  • Pyodide 314.x (Python 3.14, pandas 3.0) is a separate step.

Pyodide fetches every wheel an app needs at once. `python -m http.server`
queues only 5 pending connections, and on macOS the rest are reset. Pyodide
skips a package it could not fetch, so the app later fails to import it.
- Python 3.12 -> 3.13. The libsass wheel is rebuilt for the new
  pyemscripten_2025_0 platform, and the typeshed stubs target 3.13.
- Pyodide 0.29 converts Python dicts to plain JS objects in toJs(), so the
  ASGI event handlers ask for that directly instead of building an object
  from a Map.
- Pyodide 0.28 dropped info.version from pyodide-lock.json, which
  orig_pyodide_lock() used to notice a newly unpacked Pyodide.
- joblib now warns on import that it will run in serial mode, so tell it
  not to try multiprocessing.
Pyodide 0.29.5 ships pydantic 2.12.5, which meets shinychat 0.7's
pydantic>=2.11.
@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Unit tests only — the pure-logic modules in src/. The React components, hooks, engine proxies and service worker are covered by the pytest + Playwright suites in tests/, which are not measured here.

Coverage report

St.❔
Category Percentage Covered / Total
🟢 Statements 100% 1994/1994
🟢 Branches 100% 400/400
🟢 Functions 100% 96/96
🟢 Lines 100% 1994/1994

Test suite run success

342 tests passing in 20 suites.

Report generated by 🧪jest coverage report action from 76626bb

@schloerke

Copy link
Copy Markdown
Collaborator Author

Closing in favor of posit-dev/shinylive#263, which upgrades to Pyodide 314.0.7.

@schloerke schloerke closed this Nov 9, 2026
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