Run mypy to verify Python data types.

This commit is contained in:
Don Cross
2023-02-13 12:30:16 -05:00
parent 54181605a0
commit 740ef86d31
2 changed files with 12 additions and 2 deletions

View File

@@ -8,7 +8,17 @@ Fail()
[[ "$1" == "" || "$1" == "-v" ]] || Fail "Invalid command line options."
python3 --version || Fail "Cannot print python version"
echo "$0: running pylint"
python3 -m pylint --init-hook="import sys; sys.setrecursionlimit(2000)" ../source/python/astronomy/astronomy.py || Fail "pylint detected problems"
echo "$0: running mypy"
cd ../source/python/astronomy || Fail "error changing to Python source directory"
mypy -m astronomy || Fail "error checking types using mypy"
cd ../../../generate || Fail "error changing back to generate directory"
echo ""
echo "$0: running unit tests"
python3 test.py $1 all || Fail "Failed Python unit tests."
for file in temp/py_longitude_*.txt; do
./generate $1 check ${file} || Fail "Failed verification of file ${file}"