From 025c05ddf77cd8b585d2a1d0a7d07972c21d51fe Mon Sep 17 00:00:00 2001 From: "Yuichiro Tachibana (Tsuchiya)" Date: Tue, 26 Dec 2023 16:42:47 +0900 Subject: [PATCH 1/2] Fix the altair version specification to be <5.2.0 to avoid conflicts with user specifications --- packages/kernel/src/worker.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/kernel/src/worker.ts b/packages/kernel/src/worker.ts index d1b725ba3..fbf39ff05 100644 --- a/packages/kernel/src/worker.ts +++ b/packages/kernel/src/worker.ts @@ -177,7 +177,7 @@ async function loadPyodideAndPackages() { console.debug("Loading stlite-server, and streamlit"); await pyodide.loadPackage("micropip"); const micropip = pyodide.pyimport("micropip"); - await micropip.install(["altair==5.1.2"]); // Altair>=5.2.0 checks PyArrow version and emits an error (https://github.com/altair-viz/altair/pull/3160) + await micropip.install(["altair<5.2.0"]); // Altair>=5.2.0 checks PyArrow version and emits an error (https://github.com/altair-viz/altair/pull/3160) await micropip.install.callKwargs([wheels.stliteServer], { keep_going: true, }); From c3131d8cdf781a3564a647638a125bcdf28b3771 Mon Sep 17 00:00:00 2001 From: "Yuichiro Tachibana (Tsuchiya)" Date: Tue, 26 Dec 2023 16:43:25 +0900 Subject: [PATCH 2/2] Specify the altair version at the build phase of desktop apps --- packages/desktop/bin/dump_artifacts.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/desktop/bin/dump_artifacts.ts b/packages/desktop/bin/dump_artifacts.ts index 69d9585b9..68ee3625e 100755 --- a/packages/desktop/bin/dump_artifacts.ts +++ b/packages/desktop/bin/dump_artifacts.ts @@ -129,6 +129,10 @@ async function installStreamlitWheels( pyodide: PyodideInterface, options: InstallStreamlitWheelsOptions ) { + const micropip = pyodide.pyimport("micropip"); + + await micropip.install(["altair<5.2.0"]); // Altair>=5.2.0 checks PyArrow version and emits an error (https://github.com/altair-viz/altair/pull/3160) + if (options.useLocalKernelWheels) { const stliteKernelDir = path.dirname(require.resolve("@stlite/kernel")); // -> /path/to/kernel/dist const stliteKernelPyDir = path.resolve(stliteKernelDir, "../py"); // -> /path/to/kernel/py @@ -162,7 +166,6 @@ async function installStreamlitWheels( `https://cdn.jsdelivr.net/npm/@stlite/kernel@${version}${wheelFile.name}` ); - const micropip = pyodide.pyimport("micropip"); console.log("Install", wheelUrls); await micropip.install.callKwargs(wheelUrls, { keep_going: true }); }