1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-01-18 20:11:20 +00:00

dev_scripts: pylint: check both Python Versions

Check both "python" and "python3" for the pylint package, as it is
possible that pylint will be installed via Python 3 on Python 2 systems.
This commit is contained in:
Sergei Trofimov 2018-07-10 12:19:23 +01:00 committed by setrofim
parent 5714c8e6a1
commit ae4fdb9e77

View File

@ -1,6 +1,4 @@
#!/bin/bash #!/bin/bash
set -e
DEFAULT_DIRS=( DEFAULT_DIRS=(
wa wa
) )
@ -34,7 +32,15 @@ compare_versions() {
return 0 return 0
} }
pylint_version=$(python3 -c 'from pylint.__pkginfo__ import version; print(version)') pylint_version=$(python -c 'from pylint.__pkginfo__ import version; print(version)' 2>/dev/null)
if [ "x$pylint_version" == "x" ]; then
pylint_version=$(python3 -c 'from pylint.__pkginfo__ import version; print(version)' 2>/dev/null)
fi
if [ "x$pylint_version" == "x" ]; then
echo "ERROR: no pylint verison found; is it installed?"
exit 1
fi
compare_versions $pylint_version "1.9.2" compare_versions $pylint_version "1.9.2"
result=$? result=$?
if [ "$result" == "2" ]; then if [ "$result" == "2" ]; then
@ -42,6 +48,7 @@ if [ "$result" == "2" ]; then
exit 1 exit 1
fi fi
set -e
THIS_DIR="`dirname \"$0\"`" THIS_DIR="`dirname \"$0\"`"
CWD=$PWD CWD=$PWD
pushd $THIS_DIR > /dev/null pushd $THIS_DIR > /dev/null