Details
Description
First of all, thanks for making the *pyi tool available for other bindings!
I have been trying to use it, but it wasn't so straight forward.
First I tried it on the the example "samplebinding". There it ran into the first error:
pyside-pyside-setup\examples\samplebinding>shiboken6-genpyi Universe.pyd Traceback (most recent call last): File "<string>", line 1, in <module> File "shibokensupport/signature/lib/pyi_generator.py", line 342, in main File "shibokensupport/signature/lib/pyi_generator.py", line 287, in generate_pyi File "shibokensupport/signature/lib/pyi_generator.py", line 193, in find_imports NameError: name 'PySide6' is not defined
I then copied the script from "pyside-pyside-setup\sources\shiboken6\shibokenmodule\files.dir\shibokensupport\signature\lib\pyi_generator.py". This one gave a more detailed error message:
... File "pyside-pyside-setup\examples\samplebinding\pyi_generator.py", line 156, in find_imports return [imp for imp in PySide6.__all__ if f"PySide6.{imp}." in text] NameError: name 'PySide6' is not defined
It looks like the script depends itself on PySide6. I added "import PySide6" on the top and this time the script ran.
Then I tried it then on the "widgetbinding" example, with the additional import. Again an error:
pyside-pyside-setup\examples\widgetbinding>python pyi_generator.py wiggly.pyd Traceback (most recent call last): File "pyside-pyside-setup\examples\widgetbinding\pyi_generator.py", line 310, in <module> main() File "pyside-pyside-setup\examples\widgetbinding\pyi_generator.py", line 307, in main generate_pyi(module, outpath, options=options) File "pyside-pyside-setup\examples\widgetbinding\pyi_generator.py", line 214, in generate_pyi import_name, plainname, outfilepath = find_module(import_name, outpath, options._pyside_call) File "pyside-pyside-setup\examples\widgetbinding\pyi_generator.py", line 205, in find_module __import__(plainname) ImportError: DLL load failed while importing wiggly: The specified module could not be found.
Looks like is also not finding the PySide DLLs. I then added "import PySide6.QtWidgets" to
"pyi_generator.py" and finally it works.
Am I missing something, or is this a bug?