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
Extension version (available under the Extensions sidebar): v2020.12.424452561
OS and version: Linux
Python version (& distribution if applicable, e.g. Anaconda): Python 3.8
Type of virtual environment used (N/A | venv | virtualenv | conda | ...): venv
Relevant/affected Python packages and their versions: all of them
We use a custom mypy plugin in a project that is also commonly installed in "editable mode" (pip install -e). Editable mode installs do not link files to site-packages and instead populate the easy-install.pth file, which is used to populate sys.path.
Since the change in #14014, the extension is removing the value matching that of the workspace directory, which would match the value in easy_install.pth, effectively removing the entire project from sys.path and making the plugins invisible to mypy, which will make it crash on launch.
Note that this behavior isn't specific to mypy. Any similar customization of a lint tool (e.g. flake8) is similarly broken.
The text was updated successfully, but these errors were encountered:
If I may, a better fix for the "don't add the script directory to sys.path" would be to run pythonFiles/pyvsc-run-isolated.py using some random empty working directory, and then restoring the correct cwd with os.chdir().
Environment data
We use a custom mypy plugin in a project that is also commonly installed in "editable mode" (
pip install -e
). Editable mode installs do not link files tosite-packages
and instead populate theeasy-install.pth
file, which is used to populatesys.path
.Since the change in #14014, the extension is removing the value matching that of the workspace directory, which would match the value in
easy_install.pth
, effectively removing the entire project fromsys.path
and making the plugins invisible to mypy, which will make it crash on launch.Note that this behavior isn't specific to mypy. Any similar customization of a lint tool (e.g. flake8) is similarly broken.
The text was updated successfully, but these errors were encountered: