Skip to content

Commit b9eb74e

Browse files
committed
webassembly/variants/pyscript: Add pyscript variant.
This commit adds a pyscript variant for use in https://pyscript.net/. The configuration is: - No ASYNCIFY, in order to keep the WASM size down and have good performance. - MICROPY_CONFIG_ROM_LEVEL_FULL_FEATURES to enable most features. - Custom manifest that includes many of the python-stdlib libraries. - MICROPY_GC_SPLIT_HEAP_AUTO to increase GC heap size instead of doing a collection when memory is exhausted. This is needed because ASYNCIFY is disabled. Instead the GC collection is run at the top-level before executing any Python code. - No MICROPY_VARIANT_ENABLE_JS_HOOK because there is no asynchronous keyboard input to interrupt a running script. Signed-off-by: Damien George <[email protected]>
1 parent 6ff3e35 commit b9eb74e

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
require("abc")
2+
require("base64")
3+
require("collections")
4+
require("collections-defaultdict")
5+
require("copy")
6+
require("datetime")
7+
require("fnmatch")
8+
require("functools")
9+
require("gzip")
10+
require("hmac")
11+
require("html")
12+
require("inspect")
13+
require("io")
14+
require("itertools")
15+
require("locale")
16+
require("logging")
17+
require("operator")
18+
require("os")
19+
require("os-path")
20+
require("pathlib")
21+
require("stat")
22+
require("tarfile")
23+
require("tarfile-write")
24+
require("time")
25+
require("unittest")
26+
require("uu")
27+
require("zlib")
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#define MICROPY_CONFIG_ROM_LEVEL (MICROPY_CONFIG_ROM_LEVEL_FULL_FEATURES)
2+
#define MICROPY_GC_SPLIT_HEAP (1)
3+
#define MICROPY_GC_SPLIT_HEAP_AUTO (1)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
JSFLAGS += -s ALLOW_MEMORY_GROWTH
2+
3+
FROZEN_MANIFEST ?= variants/pyscript/manifest.py

0 commit comments

Comments
 (0)