Skip to content

feat: upgrade Pyodide from 0.27.7 to 314.0.7 - #263

Draft
schloerke wants to merge 4 commits into
schloerke/233-canonical-lock-namesfrom
schloerke/254-investigation-v2
Draft

schloerke wants to merge 4 commits into
schloerke/233-canonical-lock-namesfrom
schloerke/254-investigation-v2

Conversation

@schloerke

@schloerke schloerke commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator

Closes posit-dev/shinylive#254. Stacked on posit-dev/shinylive#262.

The libsass wheel for Pyodide 314 is built and published by gadenbuie/libsass-python#1.

Pyodide 314 runs Python 3.14 and ships pydantic 2.12.5 and orjson 3.11.8. That lets shinychat move to 0.7.2 (it needs pydantic ≥ 2.11) and brings orjson past the version shiny asks for. I chose 314 over 0.29 to skip a second upgrade later. It brings pandas 3.0; every Python example works with it.

Lockfile

Regenerated with the fix from posit-dev/shinylive#262. Notable moves: shinychat 0.6.1 → 0.7.2, plotly 5.23 → 7.1, plotnine 0.14 → 0.15, markdown-it-py 3 → 4, black 24 → 26. starlette, anyio, sniffio, platformdirs and narwhals now come from Pyodide itself. python-multipart, tenacity, pypng, uc-micro-py, appdirs and zipp drop out because nothing needs them anymore.

Changes needed by the upgrade

  • toJs() returns plain objects for dicts (Pyodide 0.29). The HTTP and websocket bridges passed the result to Object.fromEntries(), which would have broken every request. They now pass dict_converter: Object.fromEntries, as processReturnValue() already does.
  • Pyodide's starlette lists no dependencies, but imports anyio. Added through EXTRA_DEPENDENCIES.
  • altair. Pyodide ships 6.0.0, which leaves NaN in pandas 3's new string columns and breaks the altair example with invalid JSON. 6.3.0 fixes it, so shinylive_requirements.json now takes altair from PyPI. posit-dev/shinylive#270 already lets the lockfile replace a Pyodide package.
  • joblib now finds multiprocessing and warns that it will "operate in serial mode". We set JOBLIB_MULTIPROCESSING=0, which turns this off quietly.
  • plotnine 0.15 turns a 3-digit hex color such as color="#666" into the invalid #666FF. This is a plotnine bug, not a Pyodide one: plotnine 0.15.9 with mizani 0.14.6 fails the same way outside Pyodide, with pandas 2 or 3. The old lock had plotnine 0.14.5, so user apps that use 3-digit hex colors with plotnine will break after this upgrade. The plot_interact_exclude example now uses #666666.
  • pyodide-lock.json dropped info.version (0.28), and the rest of its info block is the same across patch releases. orig_pyodide_lock() now treats a pyodide-lock.json without shiny in it as freshly unpacked; this assumes Pyodide never ships shiny. A pyodide-lock.json it cannot read now raises an error instead of overwriting the saved original.
  • anyio no longer gets exceptiongroup through EXTRA_DEPENDENCIES; Python 3.11+ has ExceptionGroup built in.
  • Local wheels. update_packages_lock and update_packages_lock_local read the wheels in packages/ and expect one per package. They now depend on those wheels, whose rules remove older copies, so a leftover cp312 libsass wheel in an existing checkout no longer breaks them. The libsass wheel rule no longer depends on itself.
  • The Pyodide tarball now has *-tests.zip files; they're skipped like the old *test*.tar ones.
  • create_typeshed.py targets Python 3.14.
  • src/pyodide/ is the usual copy from make pyodide_js.

Test servers

Pyodide 314 asks for every wheel an app needs at the same time. http.server keeps only 5 connections waiting to be accepted, and macOS resets the others with ERR_CONNECTION_RESET. As a result, packages failed to load at random in the example tests. Both test servers now come from tests/static_server.py, which queues 128 connections. Users who serve an export with python -m http.server on macOS may hit the same thing.

@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 098095f

Pyodide 314 ships Python 3.14, pydantic 2.12.5 and orjson 3.11.8, so
shinychat can move to 0.7.x. The lockfile is regenerated with the #233
fix, so the pure-Python pins catch up with PyPI too.

- toJs() now turns dicts into plain objects, which Object.fromEntries()
  can't take. Pass `dict_converter: Object.fromEntries` instead.
- Pyodide's own starlette lists no dependencies but imports anyio. Add
  it through EXTRA_DEPENDENCIES.
- Pyodide's altair 6.0.0 sends NaN from pandas 3 string columns as
  invalid JSON. Take altair 6.3.0 from PyPI, and let our lockfile replace
  a Pyodide package (the check meant to stop this never ran).
- Set JOBLIB_MULTIPROCESSING=0. joblib now finds `multiprocessing` and
  warns that it will run in serial mode.
- plotnine 0.15 turns the colour "#666" into the invalid "#666FF"; use
  "#666666" in the plot_interact_exclude example.
- Pyodide 0.28 dropped `info.version` from pyodide-lock.json, so compare
  the whole `info` block to tell when it changed.
- Skip the new `*-tests.zip` files when unpacking Pyodide.
- The test servers queue more connections. Pyodide now asks for every
  wheel at once, and macOS resets anything past `http.server`'s queue
  of 5, so packages failed to load at random.

Closes #254
…son by shiny

pyodide-lock.json's info block no longer has a Pyodide version, and what
it has is the same across patch releases, so comparing it misses an
upgrade such as 314.0.6 to 314.0.7. A lock without shiny in it is always
newly unpacked.

Both test servers now come from tests/static_server.py.
…cking, and stop overwriting a clean saved Pyodide lock

- Python 3.14 has ExceptionGroup built in, so anyio no longer needs exceptiongroup.
- update_packages_lock and update_packages_lock_local read the local wheels in packages/ and expect one per package. They now depend on those wheels, whose rules remove older copies, so a leftover cp312 libsass wheel no longer breaks them.
- Remove the libsass wheel rule's dependency on itself.
- orig_pyodide_lock no longer copies an unreadable pyodide-lock.json over the saved original.
@schloerke
schloerke marked this pull request as ready for review November 10, 2026 19:06
@schloerke
schloerke force-pushed the schloerke/254-investigation-v2 branch from a89cd02 to 098095f Compare November 10, 2026 19:06
@schloerke
schloerke marked this pull request as draft November 10, 2026 19:06

This branch has not been deployed

No deployments
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.

Upgrade Pyodide from 0.27.7

1 participant