From c8bfa9c7aa5019b14762fc617368e4455584ea8e Mon Sep 17 00:00:00 2001 From: Jeff Jennings Date: Thu, 10 Oct 2024 15:23:05 -0400 Subject: [PATCH 1/8] add comment to makefile --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index bf17a176..e2b7a002 100644 --- a/Makefile +++ b/Makefile @@ -18,6 +18,7 @@ CONVERTFLAGS = --make-index --preprocessors=nbconvert.preprocessors.ExtractOutpu init: python -m pip install -U -r requirements-dev.txt +# nbcollection 'convert' also runs 'execute', so just calling 'convert' here build: convert buildall: convertall From e0924df39351fa0ed7824f0d5845781e258ecb3c Mon Sep 17 00:00:00 2001 From: Jeff Jennings Date: Thu, 10 Oct 2024 15:30:13 -0400 Subject: [PATCH 2/8] try easy catch of error in bash loop --- Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index e2b7a002..78f31a5a 100644 --- a/Makefile +++ b/Makefile @@ -37,8 +37,8 @@ convert: _paths=($(MODIFIED_RQT_PATHS)); \ for notebook in ${MODIFIED_NOTEBOOKS}; do \ echo Installing requirements from $${_paths[i]}; \ - python -m pip install --force-reinstall -r $${_paths[i]} > /dev/null; \ - nbcollection convert ${CONVERTFLAGS} ${FLAGS} $$notebook; \ + ! python -m pip install --force-reinstall -r $${_paths[i]} > /dev/null; \ + ! nbcollection convert ${CONVERTFLAGS} ${FLAGS} $$notebook; \ i=$$((i+1)); \ done @@ -57,8 +57,8 @@ convertall: _paths=($(ALL_RQT_PATHS)); \ for notebook in ${ALL_NOTEBOOKS}; do \ echo Installing requirements from $${_paths[i]}; \ - python -m pip install --force-reinstall -r $${_paths[i]} > /dev/null; \ - nbcollection convert ${CONVERTFLAGS} ${FLAGS} $$notebook; \ + ! python -m pip install --force-reinstall -r $${_paths[i]} > /dev/null; \ + ! nbcollection convert ${CONVERTFLAGS} ${FLAGS} $$notebook; \ i=$$((i+1)); \ done From 5cc832a754ef0dbcb98811acb52af2c84e6d8e41 Mon Sep 17 00:00:00 2001 From: Jeff Jennings Date: Thu, 10 Oct 2024 15:34:58 -0400 Subject: [PATCH 3/8] intentional break notebook to test error catch --- tutorials/plot-catalog/plot-catalog.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tutorials/plot-catalog/plot-catalog.ipynb b/tutorials/plot-catalog/plot-catalog.ipynb index 7c0cea56..142fa440 100755 --- a/tutorials/plot-catalog/plot-catalog.ipynb +++ b/tutorials/plot-catalog/plot-catalog.ipynb @@ -38,7 +38,7 @@ "metadata": {}, "outputs": [], "source": [ - "import numpy as np\n", + "import numpyxx as np\n", "\n", "# Set up matplotlib\n", "import matplotlib.pyplot as plt\n", From 366733411d00ef4ec8bd220b3188d6af34492d61 Mon Sep 17 00:00:00 2001 From: Jeff Jennings Date: Thu, 10 Oct 2024 15:48:37 -0400 Subject: [PATCH 4/8] try again to catch bash error --- Makefile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 78f31a5a..bbae3f11 100644 --- a/Makefile +++ b/Makefile @@ -33,12 +33,13 @@ execute: done convert: + set -e; \ i=0; \ _paths=($(MODIFIED_RQT_PATHS)); \ for notebook in ${MODIFIED_NOTEBOOKS}; do \ echo Installing requirements from $${_paths[i]}; \ - ! python -m pip install --force-reinstall -r $${_paths[i]} > /dev/null; \ - ! nbcollection convert ${CONVERTFLAGS} ${FLAGS} $$notebook; \ + python -m pip install --force-reinstall -r $${_paths[i]} > /dev/null; \ + nbcollection convert ${CONVERTFLAGS} ${FLAGS} $$notebook; \ i=$$((i+1)); \ done @@ -57,8 +58,8 @@ convertall: _paths=($(ALL_RQT_PATHS)); \ for notebook in ${ALL_NOTEBOOKS}; do \ echo Installing requirements from $${_paths[i]}; \ - ! python -m pip install --force-reinstall -r $${_paths[i]} > /dev/null; \ - ! nbcollection convert ${CONVERTFLAGS} ${FLAGS} $$notebook; \ + python -m pip install --force-reinstall -r $${_paths[i]} > /dev/null; \ + nbcollection convert ${CONVERTFLAGS} ${FLAGS} $$notebook; \ i=$$((i+1)); \ done From c5be035fdeb5e8c756d6d7c713971f568d45104a Mon Sep 17 00:00:00 2001 From: Jeff Jennings Date: Thu, 10 Oct 2024 15:53:03 -0400 Subject: [PATCH 5/8] apply flag to catch bash error to all bash loops in makefile --- Makefile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Makefile b/Makefile index bbae3f11..89f09e48 100644 --- a/Makefile +++ b/Makefile @@ -22,7 +22,11 @@ init: build: convert buildall: convertall +# 'set -e' is used to cause the bash loop to immediately exit on a failure. +# without this, the github actions workflow can succeed even if commands in these +# bash loops (installing packages, executing notebooks, converting notebooks) fail execute: + set -e; \ i=0; \ _paths=($(MODIFIED_RQT_PATHS)); \ for notebook in ${MODIFIED_NOTEBOOKS}; do \ @@ -44,6 +48,7 @@ convert: done executeall: + set -e; \ i=0; \ _paths=(${ALL_RQT_PATHS}); \ for notebook in ${ALL_NOTEBOOKS}; do \ @@ -54,6 +59,7 @@ executeall: done convertall: + set -e; \ i=0; \ _paths=($(ALL_RQT_PATHS)); \ for notebook in ${ALL_NOTEBOOKS}; do \ From 77053d380c47e5051fa19c7a4bbc903a1f955fab Mon Sep 17 00:00:00 2001 From: Jeff Jennings Date: Thu, 10 Oct 2024 15:54:53 -0400 Subject: [PATCH 6/8] fix intentionally broken notebook --- tutorials/plot-catalog/plot-catalog.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tutorials/plot-catalog/plot-catalog.ipynb b/tutorials/plot-catalog/plot-catalog.ipynb index 142fa440..7c0cea56 100755 --- a/tutorials/plot-catalog/plot-catalog.ipynb +++ b/tutorials/plot-catalog/plot-catalog.ipynb @@ -38,7 +38,7 @@ "metadata": {}, "outputs": [], "source": [ - "import numpyxx as np\n", + "import numpy as np\n", "\n", "# Set up matplotlib\n", "import matplotlib.pyplot as plt\n", From b28a9e3faaf0db8874ea82f73d3e4dbc07471ec1 Mon Sep 17 00:00:00 2001 From: Jeff Jennings Date: Thu, 10 Oct 2024 15:56:27 -0400 Subject: [PATCH 7/8] test that nbcollection convert failure triggers CI failure --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 89f09e48..66f089e5 100644 --- a/Makefile +++ b/Makefile @@ -65,7 +65,7 @@ convertall: for notebook in ${ALL_NOTEBOOKS}; do \ echo Installing requirements from $${_paths[i]}; \ python -m pip install --force-reinstall -r $${_paths[i]} > /dev/null; \ - nbcollection convert ${CONVERTFLAGS} ${FLAGS} $$notebook; \ + nbcollection convert --blah ${CONVERTFLAGS} ${FLAGS} $$notebook; \ i=$$((i+1)); \ done From 3880fc012ce0ae35601ef0c66e1b5a648e08ce9f Mon Sep 17 00:00:00 2001 From: Jeff Jennings Date: Thu, 10 Oct 2024 15:58:49 -0400 Subject: [PATCH 8/8] everything's comin up milhouse --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 66f089e5..89f09e48 100644 --- a/Makefile +++ b/Makefile @@ -65,7 +65,7 @@ convertall: for notebook in ${ALL_NOTEBOOKS}; do \ echo Installing requirements from $${_paths[i]}; \ python -m pip install --force-reinstall -r $${_paths[i]} > /dev/null; \ - nbcollection convert --blah ${CONVERTFLAGS} ${FLAGS} $$notebook; \ + nbcollection convert ${CONVERTFLAGS} ${FLAGS} $$notebook; \ i=$$((i+1)); \ done