Skip to content

Commit be4ceab

Browse files
Merge pull request #173 from pyscript/micropython-variants
Added ability to run settrace/ulab variants
2 parents c21901a + 75695d5 commit be4ceab

File tree

5 files changed

+18
-6
lines changed

5 files changed

+18
-6
lines changed

docs/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

esm/interpreter/micropython.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,19 @@ export default {
3535
stderr: buffered(console.error),
3636
stdout: buffered(console.log),
3737
});
38+
39+
// ordered extra variants: settrace, settrace-ulab, ulab
40+
const variants = [];
41+
if (config.debug) variants.push('settrace');
42+
if (config.packages?.includes('ulab')) {
43+
config.packages.splice(config.packages.indexOf('ulab'), 1);
44+
variants.push('ulab');
45+
}
46+
3847
url = url.replace(/\.m?js$/, '.wasm');
48+
for (const variant of variants)
49+
url = url.replace(/\.wasm$/, `-${variant}.wasm`);
50+
3951
progress('Loading MicroPython');
4052
const interpreter = await get(loadMicroPython({ linebuffer: false, stderr, stdout, url }));
4153
globalThis[js_modules].set('-T-', this.transform.bind(this, interpreter));

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "polyscript",
3-
"version": "0.20.11",
3+
"version": "0.20.12",
44
"description": "PyScript single core to rule them all",
55
"main": "./esm/index.js",
66
"types": "./types/polyscript/esm/index.d.ts",
@@ -98,6 +98,6 @@
9898
"to-json-callback": "^0.1.1"
9999
},
100100
"worker": {
101-
"blob": "sha256-wV2VvqA0udjI0o18pxqLaV8Msd4TO1+sLwVPI/cTD+s="
101+
"blob": "sha256-LHTqIXWndhVNsTliZi+xurqDIM2W1he56dcQmAicAQc="
102102
}
103103
}

0 commit comments

Comments
 (0)