<commit_before>#!/bin/sh
# The script is meant for SDK release on Github. You need write permission on https://github.com/dropbox/dropbox-sdk-python to run this script properly.

if [ -z $1 ]; then
    echo "error: $0 needs a version number as argument.";
    exit 1
else
    set -ex
    NEW_VERSION=$1

    git checkout main
    git reset --hard HEAD
    git checkout -b "tmp-release-${NEW_VERSION}"

    perl -pi -e "s/^__version__ = .*$/__version__ = '$1'/g" dropbox/dropbox.py
    perl -pi -e 's/(\?branch=)main$/\1\v'$1'/g ;' -e 's/(\?version=)latest$/\1\stable/g ;' -e 's/(\/en\/)latest(\/)$/\1\stable\2/g ;' -e 's/(\[Latest) (Documentation\])$/\1 Release \2/g ;' README.rst

    git add -u
    git commit -m "${NEW_VERSION} release"
    git tag "v${NEW_VERSION}" -m "${NEW_VERSION} release"

    git checkout main
    git branch -D "tmp-release-${NEW_VERSION}"

    git push origin
    git push origin --tags
fi
<commit_msg>change update_version.sh to reflect the renaming of dropbox/dropbox.py to dropbox/dropbox_client.py (#294)<commit_after>#!/bin/sh
# The script is meant for SDK release on Github. You need write permission on https://github.com/dropbox/dropbox-sdk-python to run this script properly.

if [ -z $1 ]; then
    echo "error: $0 needs a version number as argument.";
    exit 1
else
    set -ex
    NEW_VERSION=$1

    git checkout main
    git reset --hard HEAD
    git checkout -b "tmp-release-${NEW_VERSION}"

    perl -pi -e "s/^__version__ = .*$/__version__ = '$1'/g" dropbox/dropbox_client.py
    perl -pi -e 's/(\?branch=)main$/\1\v'$1'/g ;' -e 's/(\?version=)latest$/\1\stable/g ;' -e 's/(\/en\/)latest(\/)$/\1\stable\2/g ;' -e 's/(\[Latest) (Documentation\])$/\1 Release \2/g ;' README.rst

    git add -u
    git commit -m "${NEW_VERSION} release"
    git tag "v${NEW_VERSION}" -m "${NEW_VERSION} release"

    git checkout main
    git branch -D "tmp-release-${NEW_VERSION}"

    git push origin
    git push origin --tags
fi

{'fraction_non_alphanumeric': 0.1692150866462793, 'fraction_numerical': 0.013761467889908258, 'mean_word_length': 2.775, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '3711786', 'n_tokens_mistral': 735, 'n_tokens_neox': 692, 'n_words': 212}