Skip to content

Commit

Permalink
fix/altair ver lt 5.2.0 (#668)
Browse files Browse the repository at this point in the history
* Fix the altair version specification to be <5.2.0 to avoid conflicts with user specifications

* Specify the altair version at the build phase of desktop apps
  • Loading branch information
whitphx authored Dec 26, 2023
1 parent de4c780 commit ba6cdc2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion packages/desktop/bin/dump_artifacts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 });
}
Expand Down
2 changes: 1 addition & 1 deletion packages/kernel/src/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
Expand Down

0 comments on commit ba6cdc2

Please sign in to comment.