Module: check_mk
Branch: master
Commit: a3ca743bc723a78b2a70619a260c1b222986feeb
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a3ca743bc723a7…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Thu Dec 6 11:25:45 2018 +0100
Use a shell wrapper for mypy to get MYPYPATH right.
Change-Id: I2162d2ffe78d666573708bebbc22799ec4b5f586
---
.dir-locals.el | 2 +-
tests/static/Makefile | 2 +-
tests/static/run_mypy | 4 ++++
3 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/.dir-locals.el b/.dir-locals.el
index 3a94cb2..871a188 100644
--- a/.dir-locals.el
+++ b/.dir-locals.el
@@ -1,4 +1,4 @@
((c++-mode . ((flycheck-cppcheck-suppressions . ("passedByValue"))))
(python-mode . ((eval setq flycheck-python-mypy-executable
(concat (projectile-locate-dominating-file default-directory
dir-locals-file)
- "tests/static/.venv/bin/mypy")))))
+ "tests/static/run_mypy")))))
diff --git a/tests/static/Makefile b/tests/static/Makefile
index 082b80c..355c8a7 100644
--- a/tests/static/Makefile
+++ b/tests/static/Makefile
@@ -15,7 +15,7 @@ PIPENV := PIPENV_NO_INHERIT=true PIPENV_VENV_IN_PROJECT=true
pipenv
.PHONY: test-mypy
test-mypy: .venv
- MYPYPATH="$(MYPYPATH)" $(PIPENV) run mypy --config-file=$(realpath
../../mypy.ini) $(FILES_TO_CHECK)
+ ./run_mypy --config-file=$(realpath ../../mypy.ini) $(FILES_TO_CHECK)
Pipfile.lock: Pipfile
$(PIPENV) lock
diff --git a/tests/static/run_mypy b/tests/static/run_mypy
new file mode 100755
index 0000000..0ffe729
--- /dev/null
+++ b/tests/static/run_mypy
@@ -0,0 +1,4 @@
+#! /bin/sh
+# mypy_path in mypy.ini doesn't support relative paths, so we need this wrapper...
:-/
+cd `dirname $0`
+MYPYPATH=`realpath typeshed` exec ./.venv/bin/mypy "$@"