Open zhuoqiang opened 8 months ago
I think adding the following to .vscode/settings.json
solved this for me 👍
"python.analysis.packageIndexDepths": [
{
"name": "",
"depth": 5
}
],
I have the same issue (with pylance)
Not only solara.component
but also solara.use_state
(basically any reacton import)
unfortunately @Lundez' fix doesnt seem to help
adding __all__
to __init__.py
can also fix the issue
@Jhsmit true, an explicit __all__
would help! For now, to calm pylance
, I replace solara
imports with more specific (deep) ones.
from solara.core import component
@component
def MyComponent():
...
A bit more work, but acceptable at least in my use case. There are TODO
tags regarding __all__
in the solara
module, so hopefully coming soon :)
pyright complains
"component" is not exported from module "solara"
for the following code, line 3turns out it is not a false alarm, see https://github.com/microsoft/pyright/issues/5929
so I guess instead of
it could be updated to re-exported using the redundant form to make pyright happy