lint: fix custom mypy cache dir setting

This commit is contained in:
Fabian Jahr 2023-07-30 11:21:41 +02:00
parent 1d4846a844
commit f9047771d6
No known key found for this signature in database
GPG key ID: F13D1E9D890798CD

View file

@ -9,14 +9,17 @@ Check for specified flake8 and mypy warnings in python files.
""" """
import os import os
from pathlib import Path
import subprocess import subprocess
import sys import sys
from importlib.metadata import metadata, PackageNotFoundError 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'] 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) # All .py files, except those in src/ (to exclude subtrees there)
FLAKE_FILES_ARGS = ['git', 'ls-files', '*.py', ':!:src/*.py'] FLAKE_FILES_ARGS = ['git', 'ls-files', '*.py', ':!:src/*.py']