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 rather common pattern in my teams is the use of sys.path.append(os.path.dirname(__file__)) in the entry point to ensure the libs are accessible for imports.
This is a rather easy pattern to find, do you think this could be used to add some folders to the PYTHON_PATH Pylance considers ? This would be useful when the entry point is not located at the workspace's root :)
It is a bit hacky though, so I'd understand if you don't want to do it
The text was updated successfully, but these errors were encountered:
@p-avital, a static type checker cannot handle dynamic changes to system paths. If you are interested in using the functionality provided by a static type checker, you should avoid using this technique.
@vegetable09, this should already work fine. If you see a specific problem, please file a separate issue. Thanks!
Hello there,
A rather common pattern in my teams is the use of
sys.path.append(os.path.dirname(__file__))
in the entry point to ensure the libs are accessible for imports.This is a rather easy pattern to find, do you think this could be used to add some folders to the PYTHON_PATH Pylance considers ? This would be useful when the entry point is not located at the workspace's root :)
It is a bit hacky though, so I'd understand if you don't want to do it
The text was updated successfully, but these errors were encountered: