From 8c355a47844296e3aab250fe61e2ecc706122e78 Mon Sep 17 00:00:00 2001 From: "Yuichiro Tachibana (Tsuchiya)" Date: Thu, 25 Jan 2024 06:10:55 +0900 Subject: [PATCH] Add ruff mock for Lite (#7133) * Add ruff mock for Lite * add changeset --------- Co-authored-by: gradio-pr-bot --- .changeset/swift-frogs-bow.md | 6 ++++++ js/wasm/src/webworker/index.ts | 1 + 2 files changed, 7 insertions(+) create mode 100644 .changeset/swift-frogs-bow.md diff --git a/.changeset/swift-frogs-bow.md b/.changeset/swift-frogs-bow.md new file mode 100644 index 000000000000..5e59a1fb31eb --- /dev/null +++ b/.changeset/swift-frogs-bow.md @@ -0,0 +1,6 @@ +--- +"@gradio/wasm": patch +"gradio": patch +--- + +fix:Add ruff mock for Lite diff --git a/js/wasm/src/webworker/index.ts b/js/wasm/src/webworker/index.ts index 046d4417a352..66fd93bbb667 100644 --- a/js/wasm/src/webworker/index.ts +++ b/js/wasm/src/webworker/index.ts @@ -80,6 +80,7 @@ async function initializeEnvironment( await micropip.install(["markdown-it-py[linkify]~=2.2.0"]); // On 3rd June 2023, markdown-it-py 3.0.0 has been released. The `gradio` package depends on its `>=2.0.0` version so its 3.x will be resolved. However, it conflicts with `mdit-py-plugins`'s dependency `markdown-it-py >=1.0.0,<3.0.0` and micropip currently can't resolve it. So we explicitly install the compatible version of the library here. await micropip.install(["anyio==3.*"]); // `fastapi` depends on `anyio>=3.4.0,<5` so its 4.* can be installed, but it conflicts with the anyio version `httpx` depends on, `==3.*`. Seems like micropip can't resolve it for now, so we explicitly install the compatible version of the library here. await micropip.add_mock_package("pydantic", "2.4.2"); // PydanticV2 is not supported on Pyodide yet. Mock it here for installing the `gradio` package to pass the version check. Then, install PydanticV1 below. + await micropip.add_mock_package("ruff", "0.1.7"); // `ruff` was added to the requirements of `gradio` for the custom components (https://github.com/gradio-app/gradio/pull/7030), but it's not working on PYodide yet. Also Lite doesn't need it, so mock it here for installing the `gradio` package to pass the version check. await micropip.install.callKwargs(gradioWheelUrls, { keep_going: true });