solara icon indicating copy to clipboard operation
solara copied to clipboard

Typing issue with solara `component`

Open Ben-Epstein opened this issue 1 year ago • 3 comments

Expected Behavior

solara.component resolves and has proper autocomplete

Current Behavior

Typing and autocomplete cannot find solara.component

image

image

Steps to Reproduce the Problem

import solara, try to use component (vscode)

Specifications

  • Solara Version: 1.43.0
  • Platform: MacOS with vscode
  • Affected Python Versions: 3.10

Note that my code runs, component is available, it's just a typing/autocomplete issue

Ben-Epstein avatar Dec 23 '24 14:12 Ben-Epstein

I see it imported here, https://github.com/widgetti/solara/blob/master/solara/init.py#L44 but you aren't exporting the available modules with __all__ = [...] -- perhaps that is why?

Ben-Epstein avatar Dec 23 '24 14:12 Ben-Epstein

I think you're correct, we have some files that are missing and __all__ / explicit re-exports. I'm hoping to take a look at this before the 2.0 release, so hopefully we can include it in that.

Related: https://github.com/widgetti/solara/issues/465

iisakkirotko avatar Dec 23 '24 15:12 iisakkirotko

Thanks @iisakkirotko -- i was coming back to report that the reportPrivateImportUsage from pyright/pylance is the complaining issue here, which confirms the __all__ theory. If you disable this error, you no longer get complaints. That's what i've done for now

"python.analysis.diagnosticSeverityOverrides": {
        "reportPrivateImportUsage": "none"
    }

Ben-Epstein avatar Dec 23 '24 15:12 Ben-Epstein