os-brick/tools/mypywrap.sh
Eric Harney d5820f5319 mypy: work around mypy bug #13214
Turn off in-project stubs for now until this bug
is fixed and in a mypy release we can consume.

https://github.com/python/mypy/issues/13214

Change-Id: Ica954cffd760d7a9d48ba38d01e0e01e84553ff8
2022-08-18 14:04:26 -04:00

25 lines
745 B
Bash

#!/bin/sh
#
# A wrapper around mypy that allows us to specify what files to run 'mypy' type
# checks on. Intended to be invoked via tox:
#
# tox -e mypy
#
# Eventually this should go away once we have either converted everything or
# converted enough and ignored [1] the rest.
#
# [1] http://mypy.readthedocs.io/en/latest/config_file.html#per-module-flags
ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
#export MYPYPATH=$ROOT_DIR/../os_brick/tests/stubs/
if [ $# -eq 0 ]; then
# if no arguments provided, use the standard converted lists
lines=$(grep -v '#' $ROOT_DIR/../mypy-files.txt)
python -m mypy $OS_MYPY_OPTS ${lines[@]}
else
# else test what the user asked us to
python -m mypy $OS_MYPY_OPTS $@
fi