<commit_before># Simple tool to help for release
# when releasing with bash, simplei source it to get asked questions. 

# misc check before starting

python -c 'import keyring'
python -c 'import twine'
python -c 'import sphinx'
python -c 'import sphinx_rtd_theme'
python -c 'import nose'

echo -n 'PREV_RELEASE (X.y.z):'
read PREV_RELEASE
echo -n 'MILESTONE (X.y):'
read MILESTONE
echo -n 'VERSION (X.y.z):'
read VERSION
echo -n 'branch (master|X.y):'
read branch

BLACK=$(tput setaf 1)
RED=$(tput setaf 1)
GREEN=$(tput setaf 2)
YELLOW=$(tput setaf 3)
BLUE=$(tput setaf 4)
MAGENTA=$(tput setaf 5)
CYAN=$(tput setaf 6)
WHITE=$(tput setaf 7)
NOR=$(tput sgr0)

echo 
echo $BLUE"Updating what's new with informations from docs/source/whatsnew/pr"$NOR
python tools/update_whatsnew.py

echo
echo $BLUE"please move the contents of "docs/source/whatsnew/development.rst" to version-X.rst"$NOR
echo $GREEN"Press enter to continue"$NOR
read

echo 
echo $BLUE"here are all the authors that contributed to this release:"$NOR
git log --format="%aN <%aE>" $PREV_RELEASE... | sort -u -f

echo 
echo $BLUE"If you see any duplicates cancel (Ctrl-C), then edit .mailmap.\n"$GREEN"Press enter to continue:"$NOR
read

echo $BLUE"generating stats"$NOR
python tools/github_stats.py --milestone $MILESTONE > stats.rst

echo $BLUE"stats.rst files generated."$NOR
echo $GREEN"Please merge it with the right file (github-stats-X.rst) and commit."$NOR
echo $GREEN"press enter to continue."$NOR
read<commit_msg>some updates to the release scripts<commit_after># Simple tool to help for release
# when releasing with bash, simplei source it to get asked questions. 

# misc check before starting

python -c 'import keyring'
python -c 'import twine'
python -c 'import sphinx'
python -c 'import sphinx_rtd_theme'
python -c 'import nose'


BLACK=$(tput setaf 1)
RED=$(tput setaf 1)
GREEN=$(tput setaf 2)
YELLOW=$(tput setaf 3)
BLUE=$(tput setaf 4)
MAGENTA=$(tput setaf 5)
CYAN=$(tput setaf 6)
WHITE=$(tput setaf 7)
NOR=$(tput sgr0)


echo -n "PREV_RELEASE (X.y.z) [$PREV_RELEASE]: "
read input
PREV_RELEASE=${input:-$PREV_RELEASE}
echo -n "MILESTONE (X.y) [$MILESTONE]: "
read input
MILESTONE=${input:-$MILESTONE}
echo -n "VERSION (X.y.z) [$VERSION]:"
read input
VERSION=${input:-$VERSION}
echo -n "branch (master|X.y) [$branch]:"
read input
branch=${input:-$branch}

ask_section(){
    echo
    echo $BLUE"$1"$NOR 
    echo -n $GREEN"Press Enter to continue, S to skip: "$GREEN
    read -n1 value
    echo 
    if [ -z $value ] || [ $value = 'y' ]  ; then
        return 0
    fi
    return 1
}



echo 
if ask_section "Updating what's new with informations from docs/source/whatsnew/pr"
then
    python tools/update_whatsnew.py

    echo
    echo $BLUE"please move the contents of "docs/source/whatsnew/development.rst" to version-X.rst"$NOR
    echo $GREEN"Press enter to continue"$NOR
    read
fi

if ask_section "Gen Stats, and authors"
then

    echo 
    echo $BLUE"here are all the authors that contributed to this release:"$NOR
    git log --format="%aN <%aE>" $PREV_RELEASE... | sort -u -f

    echo 
    echo $BLUE"If you see any duplicates cancel (Ctrl-C), then edit .mailmap.\n"$GREEN"Press enter to continue:"$NOR
    read

    echo $BLUE"generating stats"$NOR
    python tools/github_stats.py --milestone $MILESTONE > stats.rst

    echo $BLUE"stats.rst files generated."$NOR
    echo $GREEN"Please merge it with the right file (github-stats-X.rst) and commit."$NOR
    echo $GREEN"press enter to continue."$NOR
    read

fi
{'fraction_non_alphanumeric': 0.1251425313568985, 'fraction_numerical': 0.006271379703534778, 'mean_word_length': 4.078147612156295, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '480332', 'n_tokens_mistral': 1342, 'n_tokens_neox': 1243, 'n_words': 420}