Open ziriax opened 6 months ago
I'm not aware that any of the Halide core contributors have ever looked into making this work, so, yeah, it's probably nt working.
We'd be happy for someone else to do so and submit a PR, of course :-)
I was doing some quick experimentation just today on this! In short, pybind11 generated python bindings don't work with standard Python tools like pyright (VSCode's default lsp) or mypy.
I tried pybind11-stubgen with some success. Basically, after installing it, you run something like:
pybin11-stubgen halide -o path/to/site-packages
Assuming halide is installed under path/to/site-packages
.
This will generate a few .pyi
stub files and place them next to the installed halide files. Many things are still not working, though. But based on a quick look at this discussion on pybind11, some tweaks in halide's python bindings code will really help.
some tweaks in halide's python bindings code will really help.
At the moment we don't have any resources available to work on this, but we'd be very happy to review any PRs that improve the Python bindings.
I was trying out the Python bindings using Ubuntu 23.10 and the Halide16 apt packages in a Docker container with a VSCode remote connection, but I wasn't able to get code completion working.
My code did run fine, it was just the VSCode IDE that showed all kinds of errors because it didn't find the halide symbols.
Is this supposed to work correctly, or is this not supported.