mirror of
https://github.com/cosinekitty/astronomy.git
synced 2026-05-19 22:43:25 -04:00
Run mypy to verify Python data types.
This commit is contained in:
@@ -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}"
|
||||
|
||||
Reference in New Issue
Block a user