[x] I have verified there are no duplicate active or recent bugs, questions, or requests
[x] I have verified that I am using the latest version of the plugin.
Step 2: Describe your environment
Plugin version: 0.16.2
PyCharm/IDEA version: 2023.3
Mypy version: 1.7.1
Step 3: Describe the problem:
I understand that mypy has kind of funny behavior when it's run from somewhere other than the root directory of the project. However, I naively expected this plugin to always run mypy from where the .ini file is. Nope.
If you run checks on just one file, it seems to run mypy with cwd of that file. If you're as unfortunate as me and try to use mypy_path to point to local stubs or etc., with relative paths like is the norm in the mypy examples, then suddenly the plugin will be a no-op.
Steps to reproduce:
Run failing checks on a single file a dir or two down, w/o using mypy_path. See the checks work.
Set mypy = <my-code-dir> in your init file.
Run it again on the single file and see your errors disappear.
Observed Results:
Error checks went away.
Expected Results:
Error checks should keep working. Essentially, I expected the plugin to always run mypy from the root dir of the project, or the location of the .ini file.
Workaround:
Prefix all the paths in your .ini file with mypy_path = "$MYPY_CONFIG_FILE_DIR", like this:
Step 1: Are you in the right place?
Step 2: Describe your environment
0.16.2
2023.3
1.7.1
Step 3: Describe the problem:
I understand that
mypy
has kind of funny behavior when it's run from somewhere other than the root directory of the project. However, I naively expected this plugin to always run mypy from where the .ini file is. Nope.If you run checks on just one file, it seems to run
mypy
withcwd
of that file. If you're as unfortunate as me and try to usemypy_path
to point to local stubs or etc., with relative paths like is the norm in themypy
examples, then suddenly the plugin will be a no-op.Steps to reproduce:
mypy_path
. See the checks work.mypy = <my-code-dir>
in your init file.Observed Results:
Expected Results:
mypy
from the root dir of the project, or the location of the.ini
file.Workaround:
Prefix all the paths in your
.ini
file with mypy_path ="$MYPY_CONFIG_FILE_DIR"
, like this: