jjb: babeltrace: Use dev-requirements.txt when available in pylint jobs
authorMichael Jeanson <mjeanson@efficios.com>
Thu, 10 Sep 2020 20:14:27 +0000 (16:14 -0400)
committerMichael Jeanson <mjeanson@efficios.com>
Thu, 10 Sep 2020 20:15:03 +0000 (16:15 -0400)
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
scripts/babeltrace/pylint.sh

index f04f8ad870856e826cf6ba49fee91b5797989977..ffb45b9ec98a699fb4f03c00d79fd031f8e11e0f 100755 (executable)
@@ -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
This page took 0.023958 seconds and 4 git commands to generate.