mypy: Specify mypy_path and cache_dir relative to config path.

Previously, these were interpreted relative to the current directory.
This was notably causing dozens of extra var/mypy-cache directories to
be created in different places when mypy was run from Emacs Flycheck.
Use the $MYPY_CONFIG_FILE_DIR variable added in mypy 0.800.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2021-03-04 13:11:52 -08:00 committed by Tim Abbott
parent fb8d18caf8
commit cca7d30fad
1 changed files with 2 additions and 2 deletions

View File

@ -4,8 +4,8 @@ scripts_are_modules = True
show_traceback = True
# See https://zulip.readthedocs.io/en/latest/testing/mypy.html#mypy-stubs-for-third-party-modules
# for notes on how we manage mypy stubs.
mypy_path = stubs/
cache_dir = var/mypy-cache
mypy_path = $MYPY_CONFIG_FILE_DIR/stubs
cache_dir = $MYPY_CONFIG_FILE_DIR/var/mypy-cache
# Options to make the checking stricter.
check_untyped_defs = True