diff --git a/tools/release_helper.sh b/tools/release_helper.sh index dd700b5..de88d0f 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 $EDITOR to edit files when necessary" echo -n "PREV_RELEASE (X.y.z) [$PREV_RELEASE]: " read input PREV_RELEASE=${input:-$PREV_RELEASE} @@ -38,18 +39,40 @@ ask_section(){ echo echo $BLUE"$1"$NOR echo -n $GREEN"Press Enter to continue, S to skip: "$NOR - read -n1 value - echo - if [ -z $value ] || [ $value = 'y' ] ; then + if [ "$ZSH_NAME" = "zsh" ] ; then + read -k1 value + value=${value%$'\n'} + else + read -n1 value + fi + if [ -z "$value" ] || [ $value = 'y' ]; then return 0 fi return 1 } +maybe_edit(){ + echo + echo $BLUE"$1"$NOR + echo -n $GREEN"Press e to Edit $1, 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 @@ -100,6 +123,11 @@ echo "Cleaning repository" git clean -xfdi echo $GREEN"please update version number in ${RED}IPython/core/release.py${NOR} , Do not commit yet – we'll do it later."$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 | cat +maybe_edit IPython/core/release.py echo $GREEN"Press enter to continue"$NOR read @@ -142,7 +170,14 @@ then echo $GREEN"please update version number and back to .dev in ${RED}IPython/core/release.py" + 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 | 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 + echo $GREEN"Press enter to continue"$NOR read