Update mypy infrastructure

Port cinder change Id69cb519ee7300b33ff087de4e7d46cdad67d162
to os-brick.

Change-Id: I57ce2aea95fa0d307a2cab89366f8f780a109535
This commit is contained in:
Brian Rosmaita 2021-07-12 17:27:38 -04:00
parent 6c3a89d8e6
commit 98c0916336
3 changed files with 5 additions and 3 deletions

View File

@ -16,4 +16,4 @@ pycodestyle==2.6.0 # MIT
doc8>=0.8.1 # Apache-2.0 doc8>=0.8.1 # Apache-2.0
fixtures>=3.0.0 # Apache-2.0/BSD fixtures>=3.0.0 # Apache-2.0/BSD
bandit>=1.6.0,<1.7.0 # Apache-2.0 bandit>=1.6.0,<1.7.0 # Apache-2.0
mypy>=0.782 # MIT mypy>=0.910 # MIT

View File

@ -17,8 +17,8 @@ export MYPYPATH=$ROOT_DIR/../os_brick/tests/stubs/
if [ $# -eq 0 ]; then if [ $# -eq 0 ]; then
# if no arguments provided, use the standard converted lists # if no arguments provided, use the standard converted lists
lines=$(grep -v '#' $ROOT_DIR/../mypy-files.txt) lines=$(grep -v '#' $ROOT_DIR/../mypy-files.txt)
python -m mypy ${lines[@]} python -m mypy $OS_MYPY_OPTS ${lines[@]}
else else
# else test what the user asked us to # else test what the user asked us to
python -m mypy $@ python -m mypy $OS_MYPY_OPTS $@
fi fi

View File

@ -140,5 +140,7 @@ usedevelop = False
[testenv:mypy] [testenv:mypy]
description = description =
Run type checks. Run type checks.
setenv =
OS_MYPY_OPTS=--install-types --non-interactive
commands = commands =
bash tools/mypywrap.sh {posargs} bash tools/mypywrap.sh {posargs}