Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemathinc
GitHub Repository: sagemathinc/wapython
Path: blob/main/python/cpython/src/patches/03-wasm-assets.patch
1067 views
1
--- native/Tools/wasm/wasm_assets.py 2022-12-06 11:05:27
2
+++ wasm/Tools/wasm/wasm_assets.py 2023-02-02 06:59:19
3
@@ -91,21 +91,24 @@
4
"wsgiref/",
5
)
6
7
+# The module detection code doesn't work, so I manually comment out
8
+# some of these from the list, which causes the corresponding py files
9
+# to NOT be excluded.
10
OMIT_MODULE_FILES = {
11
"_asyncio": ["asyncio/"],
12
"audioop": ["aifc.py", "sunau.py", "wave.py"],
13
"_crypt": ["crypt.py"],
14
- "_curses": ["curses/"],
15
- "_ctypes": ["ctypes/"],
16
- "_decimal": ["decimal.py"],
17
+ #"_curses": ["curses/"],
18
+ #"_ctypes": ["ctypes/"],
19
+ #"_decimal": ["decimal.py"],
20
"_dbm": ["dbm/ndbm.py"],
21
"_gdbm": ["dbm/gnu.py"],
22
- "_json": ["json/"],
23
+ #"_json": ["json/"],
24
"_multiprocessing": ["concurrent/futures/process.py", "multiprocessing/"],
25
"pyexpat": ["xml/", "xmlrpc/"],
26
- "readline": ["rlcompleter.py"],
27
- "_sqlite3": ["sqlite3/"],
28
- "_ssl": ["ssl.py"],
29
+ #"readline": ["rlcompleter.py"],
30
+ #"_sqlite3": ["sqlite3/"],
31
+ #"_ssl": ["ssl.py"],
32
"_tkinter": ["idlelib/", "tkinter/", "turtle.py", "turtledemo/"],
33
"_zoneinfo": ["zoneinfo/"],
34
}
35
@@ -134,12 +137,23 @@
36
37
def get_sysconfigdata(args: argparse.Namespace) -> pathlib.Path:
38
"""Get path to sysconfigdata relative to build root"""
39
- data_name = sysconfig._get_sysconfigdata_name()
40
- if not data_name.startswith(SYSCONFIG_NAMES):
41
- raise ValueError(
42
- f"Invalid sysconfig data name '{data_name}'.", SYSCONFIG_NAMES
43
- )
44
- filename = data_name + ".py"
45
+# data_name = sysconfig._get_sysconfigdata_name()
46
+# if not data_name.startswith(SYSCONFIG_NAMES):
47
+# raise ValueError(
48
+# f"Invalid sysconfig data name '{data_name}'.", SYSCONFIG_NAMES
49
+# )
50
+# filename = data_name + ".py"
51
+
52
+ # python-wasm: Using sysconfig does NOT work for us, because
53
+ # we simply can't run our python.wasm under wasmtime (say), since too
54
+ # much is missing, but that's what is done in the Makefile. So
55
+ # we comment this out, and explicitly put the path back in, like
56
+ # was done in 3.11.beta4. Also, wasmtime is not a dependency of CoWasm.
57
+ # data_name = sysconfig._get_sysconfigdata_name()
58
+ # assert "emscripten_wasm32" in data_name
59
+ # filename = data_name + ".py"
60
+ filename = "_sysconfigdata__wasi_wasm32-wasi.py"
61
+
62
return args.builddir / filename
63
64
65
66