<commit_before>#
# This script initiates a new release.
#
# Run it like so:
#
#   bash start.sh 1.2.3
#
# where 1.2.3 is the release version.
#

set -euxo pipefail

previous_version=$(python -c 'import gensim;print(gensim.__version__)')

RELEASE=$1
export RELEASE="$RELEASE"

script_dir="$(dirname "${BASH_SOURCE[0]}")"
root=$(dirname "$script_dir")
cd "$script_dir"

git fetch upstream
git checkout upstream/develop

#
# Get rid of the local release branch, if it exists.
#
set +e
git branch -D release-"$RELEASE"
set -e

git checkout -b release-"$RELEASE"
python bump_version.py "$previous_version" "$RELEASE"

#
# N.B. grep exits with nonzero if the target string is not found
#
grep "$RELEASE" "$root/setup.py"
grep "$RELEASE" "$root/docs/src/conf.py"
grep "$RELEASE" "$root/gensim/__init__.py"

git diff | cat
git commit -a -m "bumped version to $RELEASE"

echo "Now update CHANGELOG.md and include the PRs in this release."
read -p "Press Enter to continue.  An editor window will open."
python update_changelog.py "$previous_version" "$RELEASE"<commit_msg>more fixes to release/prepare.sh<commit_after>#
# This script initiates a new release.
#
# Run it like so:
#
#   bash start.sh 1.2.3
#
# where 1.2.3 is the release version.
#

set -euxo pipefail

previous_version=$(python -c 'import gensim;print(gensim.__version__)')

RELEASE=$1
export RELEASE="$RELEASE"

script_dir="$(dirname "${BASH_SOURCE[0]}")"
root=$(cd "$script_dir/.." && pwd)
cd "$script_dir"

git fetch upstream
git checkout upstream/develop

#
# Get rid of the local release branch, if it exists.
#
set +e
git branch -D release-"$RELEASE"
set -e

git checkout -b release-"$RELEASE"
python bump_version.py "$previous_version" "$RELEASE"

#
# N.B. grep exits with nonzero if the target string is not found
#
grep "$RELEASE" "$root/setup.py"
grep "$RELEASE" "$root/docs/src/conf.py"
grep "$RELEASE" "$root/gensim/__init__.py"

set +e
git diff | cat
git commit -a -m "bumped version to $RELEASE"
set -e

echo "Now update CHANGELOG.md and include the PRs in this release."
read -p "Press Enter to continue.  An editor window will open."
python update_changelog.py "$previous_version" "$RELEASE"
{'fraction_non_alphanumeric': 0.13354898336414048, 'fraction_numerical': 0.0073937153419593345, 'mean_word_length': 4.467171717171717, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2440151', 'n_tokens_mistral': 779, 'n_tokens_neox': 730, 'n_words': 259}