Open BlueskyFR opened 1 year ago
Interesting... do you know, does an __all__ = ["TFKerasTrial"]
mechanism also meet this need?
Also, I am not able to reproduce the error you are seeing either by running pyright
directly on a main.py
like yours, or by installing the python plugin to vscode and opening such a file.
In vscode I can go-to-def so it seems to understand what determined files to look at, but I don't see any warnings or errors.
Is there a setting or something I'm missing? Can you run pyright
directly and get the same error message?
Hey @rb-determined-ai! I use the Pylance language server version 2023.5.50 through the Python VSCode extension (version v2023.8.0).
__all__
seems to have the same behavior as adding "X as X"I checked Pylance's logs but they did not provide any relevant information
Also I am running the latest pip install determined
+ Python 3.11 but the behavior is the same using Python 3.10.9
Hi!
It seems that the Determined Python package is not compatible with Python language servers because of the way it exports classes/members in
__init__.py
files.Issue in VSCode (PyLance/PyRight language server)
Fix example
Example fix proposed for this file: https://github.com/determined-ai/determined/blob/728078b5d0581c73b66392c9723ac0c800d30b80/harness/determined/keras/__init__.py#L13-L20
Result after fix
Please note that this should be applied to the entire repo as it does not only concern this file.