Skip to content

Commit

Permalink
Fix Lite dependencies (#9719)
Browse files Browse the repository at this point in the history
* Fix Lite dependencies

* add changeset

* add changeset

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
  • Loading branch information
whitphx and gradio-pr-bot authored Oct 16, 2024
1 parent 1500c3b commit 7ec57cb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
6 changes: 6 additions & 0 deletions .changeset/calm-roses-suffer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@gradio/wasm": patch
"gradio": patch
---

fix:Fix Lite dependencies
9 changes: 0 additions & 9 deletions js/wasm/src/webworker/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,6 @@ async function initializeEnvironment(
updateProgress("Loading Gradio wheels");
await pyodide.loadPackage(["ssl", "setuptools"]);
await micropip.add_mock_package("ffmpy", "0.3.0");
await micropip.install.callKwargs(
[
"typing-extensions>=4.8.0", // Typing extensions needs to be installed first otherwise the versions from the pyodide lockfile is used which is incompatible with the latest fastapi.
"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.
"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.
"fastapi<0.111.0" // `fastapi==0.111.0` added `ujson` as a dependency, but it's not available on Pyodide yet.
],
{ keep_going: true }
);
await micropip.install.callKwargs(gradioWheelUrls, {
keep_going: true
});
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ python-multipart>=0.0.9 # required for fastapi forms
pydub
pyyaml>=5.0,<7.0
semantic_version~=2.0
starlette>=0.40.0,<1.0
starlette>=0.40.0,<1.0; sys.platform != 'emscripten'
typing_extensions~=4.0
urllib3~=2.0; sys.platform == 'emscripten' # urllib3 is used for Lite support. Version spec can be omitted because urllib3==2.1.0 is prebuilt for Pyodide and urllib>=2.2.0 supports Pyodide as well.
uvicorn>=0.14.0; sys.platform != 'emscripten'
Expand Down

0 comments on commit 7ec57cb

Please sign in to comment.