From be97a1e6dba614296d30771a8426af07d1b5a671 Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Thu, 10 Sep 2020 16:14:27 -0400 Subject: [PATCH] jjb: babeltrace: Use dev-requirements.txt when available in pylint jobs Signed-off-by: Michael Jeanson --- scripts/babeltrace/pylint.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/scripts/babeltrace/pylint.sh b/scripts/babeltrace/pylint.sh index f04f8ad..ffb45b9 100755 --- a/scripts/babeltrace/pylint.sh +++ b/scripts/babeltrace/pylint.sh @@ -20,6 +20,7 @@ set -o pipefail PYTHON3=python3 +SRCDIR="$WORKSPACE/src/babeltrace" PYENV_HOME="$WORKSPACE/.pyenv/" # Delete previously built virtualenv @@ -31,15 +32,20 @@ fi virtualenv --system-site-packages -p ${PYTHON3} "$PYENV_HOME" set +ux +# shellcheck disable=SC1090 . "$PYENV_HOME/bin/activate" set -ux -pip install --quiet black -pip install --quiet flake8 +if [ -f "$SRCDIR/dev-requirements.txt" ]; then + pip install -r "$SRCDIR/dev-requirements.txt" +else + pip install --quiet black + pip install --quiet flake8 +fi exit_code=0 -cd src/babeltrace +cd "$SRCDIR" black --diff --check . | tee ../../black.out || exit_code=1 flake8 --output-file=../../flake8.out --tee || exit_code=1 -- 2.34.1