Skip to content

data: add gradio 4.0 migration hints from its own warnings and changelog - #21

Merged
cschmertz merged 1 commit into
cschmertz:mainfrom
rise11hx-cmyk:data/gradio-4-hints
Nov 18, 2026
Merged

cschmertz merged 1 commit into
cschmertz:mainfrom
rise11hx-cmyk:data/gradio-4-hints

Conversation

@rise11hx-cmyk

@rise11hx-cmyk rise11hx-cmyk commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Closes #19.

A new # gradio-4 group, five hints, every quote copied from gradio's own text:

path target quote comes from
gradio.inputs gradio.components gradio/inputs.py at gradio@3.50.2, L16-L19
gradio.outputs gradio.components gradio/outputs.py at gradio@3.50.2, L16-L20
gradio.Variable gradio.State the 4.0.0 entry of CHANGELOG.md
gradio.Audio.__init__(source) sources the same changelog line
gradio.Video.__init__(source) sources the same changelog line

The 3.x warnings are two adjacent string literals in outputs.py; the checker joins them (a Python file's adjacent literals count as the one message they build), so the quote is the sentence a user actually saw.

Left out, as the issue asks: the removals the changelog gives no replacement for — .style(), .update(), Carousel.

Checks

uv run pytest tests/test_curated.py                            2 passed (1 deselected)
uv run pytest tests/test_query.py -k curated_hints             1 passed, 106 deselected
uv run deptime index pull                                      installed index with 53 packages
uv run python bench/curated_check.py                           400 curated hints, 0 problems, 7 not checked
uv run ruff format --check src tests && uv run ruff check src tests   clean

The index check also confirms the argument hints: gradio.Audio.__init__ and gradio.Video.__init__ recorded both source and sources, so the old name is a parameter that function really took and the new name is one it really takes.

The full -m network run cannot finish on this network (it times out on pre-existing hint pages such as docs.sqlalchemy.org), so I ran the same tests/test_curated.py::_page + _quoted narrowed to the gradio group, including the #L16-L19 line windows:

gradio hints: 5
wrong: none

One thing this does not show

Curated hints enter the index at assembly (deptime/ingest/curated.py), so a prebuilt index from deptime index pull still reports its default hint — deptime check gradio 4.0.0 gradio.Variable says "hint": "seen in 3.16.0..3.50.2", and the same is true for the merged polars hint (polars.DataFrame.melt → seen in 0.15.1..1.44.2). So deptime check is not evidence here; the checks above are. If you want an end-to-end confirmation it needs an index rebuilt locally.

CHANGELOG.md gets an ### Added entry under [Unreleased].

gradio.inputs and gradio.outputs point at gradio.components, quoting the 3.x deprecation warnings in the two modules; gradio.Variable points at gradio.State and gr.Audio/gr.Video's source argument at sources, both quoting the 4.0.0 changelog.
@cschmertz
cschmertz merged commit 9d4151e into cschmertz:main Nov 18, 2026
7 checks passed
@cschmertz

Copy link
Copy Markdown
Owner

Thanks, @rise11hx-cmyk, merged. On a gradio 3.50.2 → 4.0.0 index, the upgrade check now gives a fix for all five: gradio.inputs/outputs → gradio.components, Variable → State, and source= → sources=. Before, it flagged those lines with no fix.

cschmertz added a commit that referenced this pull request Nov 18, 2026
PRs #20 and #21 each added an "Added" heading under Unreleased; fold them into one.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add gradio 4.0's migration hints: gr.inputs, gr.outputs, Variable and source=

2 participants