From dc34ec903ce29fa3e138f690b3e7fbdf40732b94 Mon Sep 17 00:00:00 2001 From: Ole Schuett Date: Fri, 24 Mar 2023 16:27:50 +0100 Subject: [PATCH] Add generate_apptainer_def_files.py to test_python.sh --- tools/apptainer/generate_apptainer_def_files.py | 6 ++---- tools/docker/scripts/test_python.sh | 2 ++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/apptainer/generate_apptainer_def_files.py b/tools/apptainer/generate_apptainer_def_files.py index c08c548419..05693cd91a 100755 --- a/tools/apptainer/generate_apptainer_def_files.py +++ b/tools/apptainer/generate_apptainer_def_files.py @@ -80,9 +80,7 @@ def main() -> None: if ncores > os.cpu_count(): print( - "WARNING: More CPU cores requested for build than available ({ncores:d} > {maxcores:d})".format( - ncores=ncores, maxcores=os.cpu_count() - ) + f"WARNING: More CPU cores requested for build than available ({ncores} > {os.cpu_count()})" ) for release in cp2k_release_list: @@ -134,7 +132,7 @@ def main() -> None: # ------------------------------------------------------------------------------ -def check_ncores(value): +def check_ncores(value: str) -> int: ivalue = int(value) if ivalue < 1: raise argparse.ArgumentTypeError("%s is an invalid number of CPU cores" % value) diff --git a/tools/docker/scripts/test_python.sh b/tools/docker/scripts/test_python.sh index 5017ab8bb6..9869d17ca3 100755 --- a/tools/docker/scripts/test_python.sh +++ b/tools/docker/scripts/test_python.sh @@ -28,6 +28,7 @@ unzip -q -d ./tools/minimax_tools/1_xData 1_xData.zip run_test ./tools/prettify/prettify_test.py run_test ./tools/minimax_tools/minimax_to_fortran_source.py --check run_test ./tools/docker/generate_dockerfiles.py --check +run_test ./tools/apptainer/generate_apptainer_def_files.py --check run_test mypy --strict ./tools/minimax_tools/minimax_to_fortran_source.py run_test mypy --strict ./tools/dashboard/generate_dashboard.py @@ -38,6 +39,7 @@ run_test mypy --strict ./tools/precommit/precommit.py run_test mypy --strict ./tools/precommit/check_file_properties.py run_test mypy --strict ./tools/precommit/format_makefile.py run_test mypy --strict ./tools/docker/generate_dockerfiles.py +run_test mypy --strict ./tools/apptainer/generate_apptainer_def_files.py run_test mypy --strict ./tools/conventions/analyze_gfortran_ast.py # TODO: Find a way to test generate_dashboard.py without git repository.