Skip to content

#14014 broke mypy integration in combination with custom mypy plugins and editable installs #15017

@elprans

Description

@elprans

Environment data

  • VS Code version: 1.52.1
  • 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue identified by VS Code Team member as probable bug

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions