From 77d1448fe5931a175f17738d6fd004151e9e92e8 Mon Sep 17 00:00:00 2001 From: Jelte Fennema-Nio Date: Tue, 23 Jul 2024 23:50:44 +0200 Subject: [PATCH 1/2] format testall.sh --- testall.sh | 52 ++++++++++++++++++++++++---------------------------- 1 file changed, 24 insertions(+), 28 deletions(-) diff --git a/testall.sh b/testall.sh index 93866db5..fe867d62 100755 --- a/testall.sh +++ b/testall.sh @@ -12,37 +12,36 @@ python="python" # Check if a command line argument was provided as an input argument. while getopts ":p:cdh" opt; do - case $opt in + case $opt in p) - python=$OPTARG - ;; + python=$OPTARG + ;; c) - clean=TRUE - ;; + clean=TRUE + ;; d) - nodoc=TRUE - ;; + nodoc=TRUE + ;; h) - echo This runs all the tests and examples and checks for pep8 compliance - echo - echo Options: - echo ' -c cleans up the latex and pdf files generated' - echo ' -p COMMAND the python command that should be used to run the tests' - echo " -d don't execute the doc tests, they can take long" - exit 0 - ;; + echo This runs all the tests and examples and checks for pep8 compliance + echo + echo Options: + echo ' -c cleans up the latex and pdf files generated' + echo ' -p COMMAND the python command that should be used to run the tests' + echo " -d don't execute the doc tests, they can take long" + exit 0 + ;; \?) - echo "Invalid option: -$OPTARG" >&2 - exit 1 - ;; + echo "Invalid option: -$OPTARG" >&2 + exit 1 + ;; :) - echo "Option -$OPTARG requires an argument." >&2 - exit 1 - ;; - esac + echo "Option -$OPTARG requires an argument." >&2 + exit 1 + ;; + esac done - # Run the examples and tests python_version=$($python --version |& sed 's|Python \(.\).*|\1|g' | head -n 1) @@ -60,7 +59,6 @@ if [ "$python_version" = '3' ]; then fi fi - if [ "$python_version" = '2' ]; then main_folder=python2_source cd $main_folder @@ -78,24 +76,22 @@ if [ "$python_version" = '2' ]; then cd .. fi - count=0 for f in "$main_folder"/examples/*.py; do echo -e '\e[32mTesting '"$f"'\e[0m' if ! $python "$(command -v coverage)" run "$f"; then exit 1 fi - ((count ++)) + ((count++)) mv .coverage .coverage.example$count done coverage combine if [ "$clean" = 'TRUE' ]; then - rm -- *.pdf *.log *.aux *.tex *.fls *.fdb_latexmk > /dev/null + rm -- *.pdf *.log *.aux *.tex *.fls *.fdb_latexmk >/dev/null fi - if [[ "$nodoc" != 'TRUE' && "$python_version" == "3" && "$python_version_long" != 3.3.* && "$python_version_long" != 3.4.* && "$python_version_long" != 3.12.* ]]; then echo -e '\e[32mChecking for errors in docs and docstrings\e[0m' cd docs From 553032d4b75b8dd106cc068bc4756c944097c6e9 Mon Sep 17 00:00:00 2001 From: Jelte Fennema-Nio Date: Tue, 23 Jul 2024 23:53:32 +0200 Subject: [PATCH 2/2] Disable doc building on 3.7 and 3.8 Some warning due to type hints --- testall.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testall.sh b/testall.sh index fe867d62..ebfcf7b6 100755 --- a/testall.sh +++ b/testall.sh @@ -92,7 +92,7 @@ if [ "$clean" = 'TRUE' ]; then rm -- *.pdf *.log *.aux *.tex *.fls *.fdb_latexmk >/dev/null fi -if [[ "$nodoc" != 'TRUE' && "$python_version" == "3" && "$python_version_long" != 3.3.* && "$python_version_long" != 3.4.* && "$python_version_long" != 3.12.* ]]; then +if [[ "$nodoc" != 'TRUE' && "$python_version" == "3" && "$python_version_long" != 3.7.* && "$python_version_long" != 3.8.* && "$python_version_long" != 3.12.* ]]; then echo -e '\e[32mChecking for errors in docs and docstrings\e[0m' cd docs set -e