I build a compiled Python extension (.pyd
file) with C++ and pybind11
. I would like to generate a single Python interface .pyi
file for my .pyd
file.
There are a few similar questions referring to the mypy
stubgen
module, however, this one produces a UnicodeError
trying to run stubgen Dummy
where Dummy
is Dummy.pyd
file:
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x90 in position 2: invalid start byte
Another project, make-stub-files does not work with .pyd
files at all, giving the ('not a python file'
error.
Are there any tools that could let me generate .pyi files either from the source .cpp
files or from compiled .pyd
files?
The issue is registered in the mypy
GitHub repository.