Invoke mypy from within runfiles

tools/mypy-watch now prints .py paths relative to the workspace root,
which makes it easy to click on them to jump to the relevant file/line
in VS Code.
This commit is contained in:
Damien Elmes 2022-03-10 12:02:04 +10:00
parent a495fbaa8d
commit d1a43a2d42

View File

@ -29,16 +29,16 @@ if subprocess.run(
"run",
"--",
"--config-file",
"qt/mypy.ini",
".bazel/bin/qt/dmypy.runfiles/ankidesktop/pylib/anki",
".bazel/bin/qt/dmypy.runfiles/ankidesktop/qt/aqt",
workspace / "qt/mypy.ini",
"pylib/anki",
"qt/aqt",
"--python-executable",
os.path.abspath("python/stubs/extendsitepkgs"),
"python/stubs/extendsitepkgs",
],
env={
"MYPYPATH": ".bazel/bin/qt/dmypy.runfiles/pyqt6",
"MYPYPATH": "../pyqt6",
"EXTRA_SITE_PACKAGES": os.path.abspath(os.getenv("EXTRA_SITE_PACKAGES")),
},
cwd=workspace,
cwd=workspace / ".bazel/bin/qt/dmypy.runfiles/ankidesktop",
).returncode:
sys.exit(1)