From d7845ecf6032e9619162cda6cec1d9e4fb0036dc 2021-11-26 22:49:48
From: Matthias Bussonnier <bussonniermatthias@gmail.com>
Date: 2021-11-26 22:49:48
Subject: [PATCH] update release script

---

diff --git a/tools/release_helper.sh b/tools/release_helper.sh
index 884bbde..a1aa263 100644
--- a/tools/release_helper.sh
+++ b/tools/release_helper.sh
@@ -7,7 +7,7 @@ python -c 'import keyring'
 python -c 'import twine'
 python -c 'import sphinx'
 python -c 'import sphinx_rtd_theme'
-python -c 'import nose'
+python -c 'import pytest'
 
 
 BLACK=$(tput setaf 1)
@@ -21,6 +21,7 @@ WHITE=$(tput setaf 7)
 NOR=$(tput sgr0)
 
 
+echo "Will use $BLUE'$EDITOR'$NOR to edit files when necessary"
 echo -n "PREV_RELEASE (X.y.z) [$PREV_RELEASE]: "
 read input
 PREV_RELEASE=${input:-$PREV_RELEASE}
@@ -36,7 +37,7 @@ BRANCH=${input:-$BRANCH}
 
 ask_section(){
     echo
-    echo $BLUE"$1"$NOR 
+    echo $BLUE"$1"$NOR
     echo -n $GREEN"Press Enter to continue, S to skip: "$NOR
     if [ "$ZSH_NAME" = "zsh" ] ; then
         read -k1 value
@@ -51,9 +52,27 @@ ask_section(){
 }
 
 
+maybe_edit(){
+    echo
+    echo $BLUE"$1"$NOR 
+    echo -n $GREEN"Press ${BLUE}e$GREEN to Edit ${BLUE}$1$GREEN, any other keys to skip: "$NOR
+    if [ "$ZSH_NAME" = "zsh" ] ; then
+        read -k1 value
+        value=${value%$'\n'}
+    else
+       read -n1 value
+    fi
+
+    echo 
+    if [ $value = 'e' ]  ; then
+        $=EDITOR $1
+    fi
+}
+
+
 
 echo 
-if ask_section "Updating what's new with informations from docs/source/whatsnew/pr"
+if ask_section "Updating what's new with information from docs/source/whatsnew/pr"
 then
     python tools/update_whatsnew.py
 
@@ -107,7 +126,8 @@ echo $GREEN"please update version number in ${RED}IPython/core/release.py${NOR} 
 echo $GREEN"I tried ${RED}sed -i bkp -e '/Uncomment/s/^# //g' IPython/core/release.py${NOR}"
 sed -i bkp -e '/Uncomment/s/^# //g' IPython/core/release.py
 rm IPython/core/release.pybkp
-git diff
+git diff | cat
+maybe_edit IPython/core/release.py
 
 echo $GREEN"Press enter to continue"$NOR
 read
@@ -153,8 +173,9 @@ then
    echo $GREEN"I tried ${RED}sed -i bkp -e '/Uncomment/s/^/# /g' IPython/core/release.py${NOR}"
    sed -i bkp -e '/Uncomment/s/^/# /g' IPython/core/release.py
    rm IPython/core/release.pybkp
-   git diff
+   git diff | cat
    echo $GREEN"Please bump ${RED}the minor version number${NOR}"
+   maybe_edit IPython/core/release.py
    echo ${BLUE}"Do not commit yet – we'll do it later."$NOR