mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-14 18:46:17 +00:00
pybricksMicropython/python-worker: consolidate loadPackage
The pyodide.loadPackage() method can take an array arg, so we don't have to call it multiple times.
This commit is contained in:
committed by
David Lechner
parent
3878ad79bd
commit
d8b8672793
@@ -90,24 +90,14 @@ async function init(): Promise<void> {
|
||||
await pyodide.runPythonAsync(`import sys; sys.path.append("${mountDir}")`);
|
||||
|
||||
// NB: using URL+import.meta.url for webpack magic - don't try to optimize it
|
||||
await pyodide.loadPackage(
|
||||
await pyodide.loadPackage([
|
||||
new URL('@pybricks/jedi/docstring-parser.whl', import.meta.url).toString(),
|
||||
);
|
||||
await pyodide.loadPackage(
|
||||
new URL('@pybricks/jedi/jedi.whl', import.meta.url).toString(),
|
||||
);
|
||||
await pyodide.loadPackage(
|
||||
new URL('@pybricks/jedi/parso.whl', import.meta.url).toString(),
|
||||
);
|
||||
await pyodide.loadPackage(
|
||||
new URL('@pybricks/jedi/pybricks-jedi.whl', import.meta.url).toString(),
|
||||
);
|
||||
await pyodide.loadPackage(
|
||||
new URL('@pybricks/jedi/pybricks.whl', import.meta.url).toString(),
|
||||
);
|
||||
await pyodide.loadPackage(
|
||||
new URL('@pybricks/jedi/typing_extensions.whl', import.meta.url).toString(),
|
||||
);
|
||||
]);
|
||||
|
||||
await pyodide.runPythonAsync(setUpPythonEnvironment);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user