Skip to content

Type stubs for shinywidgets are missing from typeshed.en.json #225

@schloerke

Description

@schloerke

Summary

During make all, scripts/create_typeshed.py reports:

Import 'shinywidgets' not found
Import 'shinywidgets' could not be resolved
Error occurred when creating type stub: Import 'shinywidgets' could not be resolved

…and the resulting build/shinylive/pyright/typeshed.en.json contains zero entries for shinywidgets, while it has full coverage for shiny, htmltools, and shinyswatch.

Confirmed pre-existing

This is not a regression introduced by any specific submodule bump. Comparing local v0.10.10 build vs. the live v0.10.9 typeshed:

build shiny entries htmltools entries shinywidgets entries
PROD v0.10.9 (live typeshed) 188 7 0
LOCAL v0.10.10 188 7 0

Impact

  • Runtime: unaffected — shinywidgets-X.Y.Z-py3-none-any.whl is still bundled into pyodide and apps using shinywidgets continue to work.
  • Editor: the in-browser pyright integration has no hover/intellisense/type-checking for import shinywidgets symbols.

Likely cause

pyright --createstub shinywidgets requires the package's transitive imports to resolve (e.g. anywidget, ipywidgets, …). The create_typeshed.py venv probably doesn't install these, so pyright bails before emitting stubs. The other three packages in PACKAGES = ("htmltools", "shiny", "shinywidgets", "shinyswatch") succeed because their dep graphs are satisfied by what's currently installed.

See scripts/create_typeshed.py:15,28-29.

Suggested fix

Ensure anywidget (and any other shinywidgets runtime deps that satisfy module resolution) are installed in the venv used by create_typeshed.py before the pyright.run("--createstub", "shinywidgets", ...) call.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions