From febbed6db1c1f33cab52bf0d0bbe31fc4ba65305 Mon Sep 17 00:00:00 2001 From: Ali Abdalla Date: Fri, 25 Oct 2024 06:55:01 +0400 Subject: [PATCH 1/3] Pin multipart version to fix issues with yanking (#9834) * pin multipart * add changeset --------- Co-authored-by: gradio-pr-bot --- .changeset/cyan-lights-sleep.md | 5 +++++ requirements.txt | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/cyan-lights-sleep.md diff --git a/.changeset/cyan-lights-sleep.md b/.changeset/cyan-lights-sleep.md new file mode 100644 index 0000000000000..c51b7dc524da1 --- /dev/null +++ b/.changeset/cyan-lights-sleep.md @@ -0,0 +1,5 @@ +--- +"gradio": patch +--- + +feat:Pin multipart version to fix issues with yanking diff --git a/requirements.txt b/requirements.txt index de88f2b6c24c5..ef0ca280405aa 100644 --- a/requirements.txt +++ b/requirements.txt @@ -14,7 +14,7 @@ packaging pandas>=1.0,<3.0 pillow>=8.0,<12.0 pydantic>=2.0 -python-multipart>=0.0.9,!=0.0.13 # required for fastapi forms. 0.0.13 was yanked from PyPI but micropip now ignores the yanked flag so we explicitly exclude it. +python-multipart==0.0.12 # required for fastapi forms. pinning to avoid yanking issues with micropip. pydub pyyaml>=5.0,<7.0 ruff>=0.2.2; sys.platform != 'emscripten' From 767643fdeccb1ae1481e1d79034317082144b371 Mon Sep 17 00:00:00 2001 From: Cornelius <39997278+cornzz@users.noreply.github.com> Date: Fri, 25 Oct 2024 07:21:15 +0200 Subject: [PATCH 2/3] Fix a bug in example textbox rendering when it is initially invisible (#9831) * Fix a bug in example textbox rendering when it is initially invisible * add changeset --------- Co-authored-by: gradio-pr-bot Co-authored-by: Freddy Boulton --- .changeset/clear-falcons-lose.md | 8 ++++++++ js/multimodaltextbox/Example.svelte | 7 +++---- js/simpletextbox/Example.svelte | 7 +++---- js/textbox/Example.svelte | 7 +++---- 4 files changed, 17 insertions(+), 12 deletions(-) create mode 100644 .changeset/clear-falcons-lose.md diff --git a/.changeset/clear-falcons-lose.md b/.changeset/clear-falcons-lose.md new file mode 100644 index 0000000000000..3ea66b2741c3d --- /dev/null +++ b/.changeset/clear-falcons-lose.md @@ -0,0 +1,8 @@ +--- +"@gradio/multimodaltextbox": patch +"@gradio/simpletextbox": patch +"@gradio/textbox": patch +"gradio": patch +--- + +fix:Fix a bug in example textbox rendering when it is initially invisible diff --git a/js/multimodaltextbox/Example.svelte b/js/multimodaltextbox/Example.svelte index 695eb161a095c..6f8456645ba19 100644 --- a/js/multimodaltextbox/Example.svelte +++ b/js/multimodaltextbox/Example.svelte @@ -15,12 +15,11 @@ let el: HTMLDivElement; function set_styles(element: HTMLElement, el_width: number): void { - if (!element || !el_width) return; - el.style.setProperty( + element.style.setProperty( "--local-text-width", - `${el_width < 150 ? el_width : 200}px` + `${el_width && el_width < 150 ? el_width : 200}px` ); - el.style.whiteSpace = "unset"; + element.style.whiteSpace = "unset"; } onMount(() => { diff --git a/js/simpletextbox/Example.svelte b/js/simpletextbox/Example.svelte index e8e8130c2987f..be119a239cfc6 100644 --- a/js/simpletextbox/Example.svelte +++ b/js/simpletextbox/Example.svelte @@ -9,12 +9,11 @@ let el: HTMLDivElement; function set_styles(element: HTMLElement, el_width: number): void { - if (!element || !el_width) return; - el.style.setProperty( + element.style.setProperty( "--local-text-width", - `${el_width < 150 ? el_width : 200}px` + `${el_width && el_width < 150 ? el_width : 200}px` ); - el.style.whiteSpace = "unset"; + element.style.whiteSpace = "unset"; } onMount(() => { diff --git a/js/textbox/Example.svelte b/js/textbox/Example.svelte index e8e8130c2987f..be119a239cfc6 100644 --- a/js/textbox/Example.svelte +++ b/js/textbox/Example.svelte @@ -9,12 +9,11 @@ let el: HTMLDivElement; function set_styles(element: HTMLElement, el_width: number): void { - if (!element || !el_width) return; - el.style.setProperty( + element.style.setProperty( "--local-text-width", - `${el_width < 150 ? el_width : 200}px` + `${el_width && el_width < 150 ? el_width : 200}px` ); - el.style.whiteSpace = "unset"; + element.style.whiteSpace = "unset"; } onMount(() => { From 854ec6ff8f3fd191372db34e3858f4777df9d7db Mon Sep 17 00:00:00 2001 From: "Yuichiro Tachibana (Tsuchiya)" Date: Sat, 26 Oct 2024 00:12:50 +0900 Subject: [PATCH 3/3] Add requirements.txt to the gradio-lib-front-end-lite cache key (#9842) --- .github/actions/install-frontend-deps/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/install-frontend-deps/action.yml b/.github/actions/install-frontend-deps/action.yml index 9c858df91339e..b465a253ea6bb 100644 --- a/.github/actions/install-frontend-deps/action.yml +++ b/.github/actions/install-frontend-deps/action.yml @@ -25,7 +25,7 @@ runs: with: path: | js/lite/dist/** - key: gradio-lib-front-end-lite-${{ hashFiles('js/**', 'client/js/**', 'gradio/**')}} + key: gradio-lib-front-end-lite-${{ hashFiles('js/**', 'client/js/**', 'gradio/**', 'requirements.txt')}} - name: Install pnpm uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # @v4 with: