From 8e9e925edf4f52589803638cc3613fa3eddde6be Mon Sep 17 00:00:00 2001 From: ChisSoc <75833833+ChisSoc@users.noreply.github.com> Date: Tue, 12 Oct 2021 23:03:30 +0200 Subject: [PATCH] Add runner scripts for development tools --- run_flake8.sh | 13 +++++++++++++ run_pytest.sh | 13 +++++++++++++ run_sphinx.sh | 14 ++++++++++++++ 3 files changed, 40 insertions(+) create mode 100755 run_flake8.sh create mode 100755 run_pytest.sh create mode 100755 run_sphinx.sh diff --git a/run_flake8.sh b/run_flake8.sh new file mode 100755 index 000000000..a9ec73285 --- /dev/null +++ b/run_flake8.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +# Runner script for flak8 to ensure +# - correct config file +# - independent from working directory + +# Change working directory to location of script +SOURCE=${BASH_SOURCE[0]} +SCRIPT_DIR="$(dirname "$SOURCE")" +cd "$SCRIPT_DIR" || (echo "Could not change to top-level project directory" && exit 1) + +# Run flake8 +flake8 --config .flake8 "$@" diff --git a/run_pytest.sh b/run_pytest.sh new file mode 100755 index 000000000..a3cbd8df6 --- /dev/null +++ b/run_pytest.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +# Runner script for pytest to ensure +# - correct config file +# - independent from working directory + +# Change working directory to location of script +SOURCE=${BASH_SOURCE[0]} +SCRIPT_DIR="$(dirname "$SOURCE")" +cd "$SCRIPT_DIR" || (echo "Could not change to top-level project directory" && exit 1) + +# Run pytest +pytest -c pytest.ini diff --git a/run_sphinx.sh b/run_sphinx.sh new file mode 100755 index 000000000..d24891dce --- /dev/null +++ b/run_sphinx.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +# Runner script for sphinx documentation build +# Usage: +# (a) run_sphinx.sh for incremental build +# (b) run_sphinx.sh clean for clean re-build + +# Change working directory to location of script +SOURCE=${BASH_SOURCE[0]} +SCRIPT_DIR="$(dirname "$SOURCE")" +cd "$SCRIPT_DIR/docs/sphinx" || (echo "Could not change to docs directory" && exit 1) + +# Run sphinx +make "$@" html