aboutsummaryrefslogtreecommitdiff
path: root/test/lint
diff options
context:
space:
mode:
authorFabian Jahr <fjahr@protonmail.com>2023-07-30 11:21:41 +0200
committerFabian Jahr <fjahr@protonmail.com>2023-09-28 13:20:25 +0200
commitf9047771d642c5887c752872b6ffbbd974603b35 (patch)
tree927c467ded775d55eaf09618c4ad4f21cb29b4df /test/lint
parent1d4846a8443be901b8a5deb0e357481af22838d0 (diff)
downloadbitcoin-f9047771d642c5887c752872b6ffbbd974603b35.tar.xz
lint: fix custom mypy cache dir setting
Diffstat (limited to 'test/lint')
-rwxr-xr-xtest/lint/lint-python.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/lint/lint-python.py b/test/lint/lint-python.py
index 6010c787cb..eabd13322e 100755
--- a/test/lint/lint-python.py
+++ b/test/lint/lint-python.py
@@ -9,14 +9,17 @@ Check for specified flake8 and mypy warnings in python files.
"""
import os
+from pathlib import Path
import subprocess
import sys
from importlib.metadata import metadata, PackageNotFoundError
+# Customize mypy cache dir via environment variable
+cache_dir = Path(__file__).parent.parent / ".mypy_cache"
+os.environ["MYPY_CACHE_DIR"] = str(cache_dir)
DEPS = ['flake8', 'lief', 'mypy', 'pyzmq']
-MYPY_CACHE_DIR = f"{os.getenv('BASE_ROOT_DIR', '')}/test/.mypy_cache"
# All .py files, except those in src/ (to exclude subtrees there)
FLAKE_FILES_ARGS = ['git', 'ls-files', '*.py', ':!:src/*.py']