leinardi / mypy-pycharm

A plugin providing both real-time and on-demand scanning of Python files with Mypy from within PyCharm/IDEA.
Apache License 2.0
188 stars 30 forks source link

Configure working directory/env vars when running mypy #96

Open theY4Kman opened 2 years ago

theY4Kman commented 2 years ago

Is your feature request related to a problem? Please describe. I often develop out of a monorepo, where my Python source root is not my project root. This has become an issue since introducing a local mypy plugin: when mypy is executed using the project root as the working directory, my mypy plugin cannot be imported; though, mypy runs fine in the terminal.

image

Describe the solution you'd like / alternatives considered The ability to customize the working directory for the invoked mypy process would be one solution that would fit my own needs. However, others may have multiple locations where plugins may be imported from, and might benefit from being able to customize the environment variables passed to the mypy process. Customizing $PYTHONPATH would also fit my needs.