nuttx-apps/interpreters/python/patch/0017-stdlib-zip-keep-pydecimal-and-trim-tooling-extras.patch
Tiago Medicci 8ba84edb0a interpreters/python: Enable using pip to install Python packages
This commit enables using `pip` as a pre-compiled (pyc) built-in
distributed along with cpython.

Signed-off-by: Tiago Medicci <tiago.medicci@espressif.com>
2026-05-18 15:08:30 -04:00

35 lines
1.2 KiB
Diff

--- a/Tools/wasm/wasm_assets.py
+++ b/Tools/wasm/wasm_assets.py
@@ -47,13 +47,20 @@
# webbrowser
"antigravity.py",
"webbrowser.py",
- # Pure Python implementations of C extensions
- "_pydecimal.py",
+ # Pure Python implementations of C extensions.
+ # NOTE: keep "_pydecimal.py" so decimal.py can fall back to it when the
+ # _decimal C extension is not built (NuttX targets do not link libmpdec).
"_pyio.py",
# concurrent threading
"concurrent/futures/thread.py",
# Misc unused or large files
"pydoc_data/",
+ # Tooling/REPL extras not needed on a constrained embedded target.
+ "unittest/",
+ "_pyrepl/",
+ "idlelib/",
+ "turtledemo/",
+ "wsgiref/",
)
# Synchronous network I/O and protocols are not supported; for example,
@@ -80,7 +87,8 @@
"_asyncio": ["asyncio/"],
"_curses": ["curses/"],
"_ctypes": ["ctypes/"],
- "_decimal": ["decimal.py"],
+ # decimal.py is intentionally NOT omitted here: it ships a pure-Python
+ # fallback (_pydecimal) used when the _decimal C ext is unavailable.
"_dbm": ["dbm/ndbm.py"],
"_gdbm": ["dbm/gnu.py"],
"_json": ["json/"],