From 2932d41f183a17e7dace0b334232a79df98643ae Mon Sep 17 00:00:00 2001 From: Jakob Stoklund Olesen Date: Wed, 25 Jan 2017 14:12:36 -0800 Subject: [PATCH] Run Python checks from test-all.sh The Python style enforcements are easy to miss otherwise. --- lib/cretonne/meta/check.sh | 12 +++--------- test-all.sh | 3 +++ 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/lib/cretonne/meta/check.sh b/lib/cretonne/meta/check.sh index 2077716eb7..655092e6cb 100755 --- a/lib/cretonne/meta/check.sh +++ b/lib/cretonne/meta/check.sh @@ -4,29 +4,23 @@ cd $(dirname "$0") runif() { if command -v "$1" > /dev/null; then - echo "=== $1 ===" + echo " === $1 ===" "$@" else echo "$1 not found" fi } -# Check Python sources for Python 3 compatibility using pylint. -# -# Install pylint with 'pip install pylint'. -runif pylint --py3k --reports=no -- *.py cdsl base cretonne isa - # Style linting. runif flake8 . # Type checking. runif mypy --py2 build.py -echo "=== Python unit tests ===" -python -m unittest discover +# Python unit tests. +runif python -m unittest discover # Then run the unit tests again with Python 3. # We get deprecation warnings about assertRaisesRegexp which was renamed in # Python 3, but there doesn't seem to be an easy workaround. runif python3 -Wignore:Deprecation -m unittest discover - diff --git a/test-all.sh b/test-all.sh index f55464ce3b..bf2270efb6 100755 --- a/test-all.sh +++ b/test-all.sh @@ -40,6 +40,9 @@ else echo "If a newer version of rustfmt is available, update this script." fi +banner "Python checks" +$topdir/lib/cretonne/meta/check.sh + PKGS="cretonne cretonne-reader cretonne-tools filecheck" cd "$topdir" for PKG in $PKGS