22 Commits
Author SHA1 Message Date
Classic298 e13e523f00 feat: bundle python-pptx and python-docx for the Pyodide code interpreter (#30382)
Asked for a PowerPoint or Word file, the model had no library for it, so it followed the prompt's "use an alternative approach" and wrote the OOXML zip by hand. The sandbox reported success and Office refused to open the result.

python-pptx and python-docx are now vendored the same way as openpyxl: their wheels (plus xlsxwriter) go through the PyPI wheel path, lxml joins the Pyodide distribution list so its wasm wheel is cached, and importing pptx or docx installs them from the bundled wheels. No prompt change is needed, since the app installs on import.

static/pyodide grows by about 3 MB (58 to 61 MB) and verifyBundledWheels() passes.

Verified in headless Chromium with pypi.org, files.pythonhosted.org and the jsDelivr CDN blocked: both packages install from the local wheels only, and a deck and a document built in the sandbox reopen with the native libraries. openpyxl, seaborn, black, pandas, matplotlib and requests still install offline. Without the change both installs fail offline.

Fixes #30361
2026-09-23 23:50:39 -04:00
Classic298 6d73780fd1 fix: bundle seaborn and give black its dependencies in the Pyodide lock (#30148)
seaborn was listed among the Pyodide distribution packages, but it is not part of that distribution, so the build wrote no wheel for it. Since seaborn is on the code interpreter's package list, it was quietly downloaded from pypi.org in the user's browser instead, which is what bundling the wheels is meant to avoid. It now takes the PyPI wheel path, like openpyxl.

The code editor's Format button was broken for non-admin users, with or without internet, because black's bundled lock entry declared no dependencies and the hand-written list next to the caller was missing packaging. black's dependencies are now declared in the lock, so that list goes back to black alone and every future caller gets them too.

Both of these shipped unnoticed because nothing checked that a listed package produced a wheel. The build now fails when one did not, naming it.

Verified offline with the network cut at undici's dispatcher: seaborn, black, the Excel roundtrip and the other listed packages all install from the bundled wheels, and a deleted wheel, a missing lock entry or a non-canonical key each fail the build.

Fixes #30145
2026-09-18 19:30:54 -04:00
Classic298 655337f7bf fix: vendor openpyxl so Excel I/O works in the Pyodide code interpreter (#30140)
openpyxl has been listed as a Pyodide package since March, but it is not part of the Pyodide distribution, so the build never wrote a wheel for it and never warned about it. In the browser code interpreter every Excel operation failed with ModuleNotFoundError: import openpyxl, pd.read_excel() and DataFrame.to_excel() alike.

It now takes the PyPI wheel path together with its dependency et-xmlfile, and the code interpreter installs it when a snippet imports openpyxl or calls pandas' Excel helpers, which need it without importing it by name.

Injected lock entries are now keyed by the canonical dashed package name, the only spelling pyodide resolves them by. As a side effect black's mypy-extensions now resolves from the bundled wheel too, so formatting Python in the editor no longer reaches out to PyPI at runtime.

Verified offline against a built static/pyodide with every network call blocked: a to_excel then read_excel roundtrip loads openpyxl and et-xmlfile from the local directory and returns the frame.

Fixes #30130
2026-09-18 10:38:02 -05:00
Timothy Jaeryang Baek 98fcb844e1 refac 2026-09-06 17:24:23 -04:00
Timothy Jaeryang Baek 4e2240aada refac 2026-04-24 18:55:39 +09:00
Timothy Jaeryang Baek 350d52f515 chore: format 2026-03-25 16:43:06 -05:00
Timothy Jaeryang Baek 8507e5eb0d refac: include black 2026-03-24 17:18:52 -05:00
Timothy Jaeryang Baek 16ee4ac7a2 refac 2026-03-24 04:57:02 -05:00
Timothy Jaeryang Baek 39100eca49 Create generate-sbom.sh 2026-03-13 22:09:10 -05:00
tarmst 0033b3fe4e Add OpenAI package to pyodide code blocks 2025-07-08 19:28:43 +00:00
Silentoplayz e3bacc3296 fix: Small fixes 2025-06-27 04:35:28 -04:00
Timothy Jaeryang Baek 4fe45d4430 refac/security: python code format endpoint 2025-06-08 20:26:07 +04:00
Timothy Jaeryang Baek eeb00a5ca2 chore: format 2025-02-20 01:01:29 -08:00
Liu Yue 3ae7302f7b build: load the proxy from the system env for Pyodide to download packages #6234 2025-02-20 16:40:31 +08:00
Timothy Jaeryang Baek 9624493b55 refac 2025-02-04 23:44:51 -08:00
Timothy Jaeryang Baek b20603e01a refac 2025-02-03 22:05:52 -08:00
Timothy J. Baek b6ad539379 refac 2024-06-18 19:44:32 -07:00
Timothy J. Baek edfe20b2e1 fix 2024-06-17 14:28:56 -07:00
Timothy J. Baek a4748af822 chore: bump pyodide 2024-06-17 14:26:10 -07:00
Timothy J. BaekandSilentoplayz 5961fc84f4 feat: seaborn added to pyodide
Co-Authored-By: Silentoplayz <50341825+Silentoplayz@users.noreply.github.com>
2024-05-19 09:46:43 -07:00
Timothy J. Baek 7f90d813bd feat: more libs for pyodide 2024-05-18 14:24:32 -07:00
Jun Siang Cheah 781c904c91 refac: fetch pyodide deps at build time, not checked into git 2024-05-18 14:30:42 +08:00