Closed IvarVirusiim closed 1 year ago
Thanks for reporting this. There is discrepancy between PyCharm and Visual Studio Code because the latter did not have issues with the imports and did not show warnings. Nevertheless, the imports are modified to comply with the "from Y import X as X" rule.
Hi @DanielDraganov , I think this issue still exists with pyvmomi==8.0.2.0.
Describe the bug
When using PyCharm and type hinting, there are warnings like those:
Reproduction steps
vim.vm.device.VirtualEthernetCard
Cannot find reference 'vm' in '__init__.pyi'
:Expected behavior
No warnings
Additional context
For this example (
vim.vm.device.VirtualEthernetCard
) using re-exports should fix them:https://typing.readthedocs.io/en/latest/source/stubs.html#imports
For example
vim.__init__.pyi
:from . import vim as vim
and in
vm.__init__.pyi
:from . import device as device