-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing stub files confuse static type checkers #1385
Comments
Aren't all the detected items the the objects present here: openPMD-api/src/binding/python/openpmd_api/__init__.py Lines 1 to 18 in 9a215b2
|
Is there a way to tell intellisense to follow this line?
Maybe it generally ignores that. Otherwise we could consider looping over the imported dicts and adding them to |
No sure about
which makes me guess that the answer to your question is no, though I'd have to read more about how |
Hm, I see, they don't query the extension module at all? Why not I wonder, it's available like any other class... So we need stubs I guess and a workflow to not have to create them manually all the time we change the bindings. |
One example on how to do so is here pybind/pybind11#2350 (comment), and I haven't kept up with how build systems have been working to provide this functionality. |
I started working on this in pyAMReX and then will propagate the solution to here, too. |
Currently, the
openpmd-api
module confuses static type checkers likepyright
:Inspecting the
openpmd-api
module viainspect
anddir
using the following:I see
However, if I use the LSP command to go to the definition of the
openpmd-api
module, I am directed to this__init__.py
in the install directory which is missing the definition forSeries
.Proposed fix
Per pybind/pybind11#2350, this can be fixed by using
pybind11-stubgen
/mypy-stubgen
/etc to generate the stubs.Documents of interest
The text was updated successfully, but these errors were encountered: