You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A static type checker (which what Pylance is) only reads your code, it doesn't execute it. So it can't execute the code in your pth files to find the paths that would have been added.
Environment data
Code Snippet
Editable packages which generate *.pth files like this:
work file, and the imports are shown. But if you have one more like this:
then you'll get errors regarding missing imports like this:
In our case, it came about due to this
pyproject.toml
config, which mapped the package to two different directories:Repro Steps
See above.
Expected behavior
Both format
pth
files should be handled, and the module should resolve properly.NOTE: unit tests, etc. all work fine even though imports are not found, so they are valid.
Actual behavior
Imports from such editable installs are incorrectly marked as missing.
Logs
I believe these are the relevant lines -- as you can see, the one package that has the different style of *.pth is not included in the list:
which is consistent with the output of:
That suggests that maybe this way of enumerating the paths isn't sufficient?
The text was updated successfully, but these errors were encountered: