Skip to content

Commit 138f266

Browse files
committed
bring back release helper from master branch
1 parent 5aa3634 commit 138f266

File tree

1 file changed

+40
-5
lines changed

1 file changed

+40
-5
lines changed

tools/release_helper.sh

Lines changed: 40 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ python -c 'import keyring'
77
python -c 'import twine'
88
python -c 'import sphinx'
99
python -c 'import sphinx_rtd_theme'
10-
python -c 'import nose'
10+
python -c 'import pytest'
1111

1212

1313
BLACK=$(tput setaf 1)
@@ -21,6 +21,7 @@ WHITE=$(tput setaf 7)
2121
NOR=$(tput sgr0)
2222

2323

24+
echo "Will use $EDITOR to edit files when necessary"
2425
echo -n "PREV_RELEASE (X.y.z) [$PREV_RELEASE]: "
2526
read input
2627
PREV_RELEASE=${input:-$PREV_RELEASE}
@@ -38,18 +39,40 @@ ask_section(){
3839
echo
3940
echo $BLUE"$1"$NOR
4041
echo -n $GREEN"Press Enter to continue, S to skip: "$NOR
41-
read -n1 value
42-
echo
43-
if [ -z $value ] || [ $value = 'y' ] ; then
42+
if [ "$ZSH_NAME" = "zsh" ] ; then
43+
read -k1 value
44+
value=${value%$'\n'}
45+
else
46+
read -n1 value
47+
fi
48+
if [ -z "$value" ] || [ $value = 'y' ]; then
4449
return 0
4550
fi
4651
return 1
4752
}
4853

4954

55+
maybe_edit(){
56+
echo
57+
echo $BLUE"$1"$NOR
58+
echo -n $GREEN"Press e to Edit $1, any other keys to skip: "$NOR
59+
if [ "$ZSH_NAME" = "zsh" ] ; then
60+
read -k1 value
61+
value=${value%$'\n'}
62+
else
63+
read -n1 value
64+
fi
65+
66+
echo
67+
if [ $value = 'e' ] ; then
68+
$EDITOR $1
69+
fi
70+
}
71+
72+
5073

5174
echo
52-
if ask_section "Updating what's new with informations from docs/source/whatsnew/pr"
75+
if ask_section "Updating what's new with information from docs/source/whatsnew/pr"
5376
then
5477
python tools/update_whatsnew.py
5578

@@ -100,6 +123,11 @@ echo "Cleaning repository"
100123
git clean -xfdi
101124

102125
echo $GREEN"please update version number in ${RED}IPython/core/release.py${NOR} , Do not commit yet – we'll do it later."$NOR
126+
echo $GREEN"I tried ${RED}sed -i bkp -e '/Uncomment/s/^# //g' IPython/core/release.py${NOR}"
127+
sed -i bkp -e '/Uncomment/s/^# //g' IPython/core/release.py
128+
rm IPython/core/release.pybkp
129+
git diff | cat
130+
maybe_edit IPython/core/release.py
103131

104132
echo $GREEN"Press enter to continue"$NOR
105133
read
@@ -142,7 +170,14 @@ then
142170

143171

144172
echo $GREEN"please update version number and back to .dev in ${RED}IPython/core/release.py"
173+
echo $GREEN"I tried ${RED}sed -i bkp -e '/Uncomment/s/^/# /g' IPython/core/release.py${NOR}"
174+
sed -i bkp -e '/Uncomment/s/^/# /g' IPython/core/release.py
175+
rm IPython/core/release.pybkp
176+
git diff | cat
177+
echo $GREEN"Please bump ${RED}the minor version number${NOR}"
178+
maybe_edit IPython/core/release.py
145179
echo ${BLUE}"Do not commit yet – we'll do it later."$NOR
180+
146181

147182
echo $GREEN"Press enter to continue"$NOR
148183
read

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy