You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With this setup, building main fails because dep.py is included in the mypy invocation, but kafka.pyi isn't transitively included in stub_files, which means kafka.pyi isn't making it into mypypath
A tree of stub files isn't included in the mypy path correctly. Currently, the integration only adds the mypy_stubs' files' immediate directory into MYPYPATH, but that won't resolve nested structures like a/__init__.py and a/b/__init__.py
I also suspect that having a/__init__.py and b/__init__.py would also error currently
Current workaround
I'm currently adding a patch file doing the equivalent of the following:
# transitively include stubsfordepsintransitive_srcs_depsets:
forfindeps.to_list():
iff.extension=="pyi":
stub_files.append(f)
# only add stub rootmypypath_parts+= [src_f.dirnameforsrc_finstub_filesifsrc_f.basename=="__stubs_root__.pyi"]
and then adding __stubs_root__.pyi to every mypy_stubs target
The text was updated successfully, but these errors were encountered:
I'm encountering a few issues with mypy_stubs:
Stubs included transitively aren't being included:
With this setup, building
main
fails becausedep.py
is included in the mypy invocation, butkafka.pyi
isn't transitively included instub_files
, which meanskafka.pyi
isn't making it intomypypath
A tree of stub files isn't included in the mypy path correctly. Currently, the integration only adds the mypy_stubs' files' immediate directory into MYPYPATH, but that won't resolve nested structures like
a/__init__.py
anda/b/__init__.py
a/__init__.py
andb/__init__.py
would also error currentlyCurrent workaround
I'm currently adding a patch file doing the equivalent of the following:
and then adding
__stubs_root__.pyi
to everymypy_stubs
targetThe text was updated successfully, but these errors were encountered: