<commit_before>#!/bin/bash

PYTHON=`which python`
REPO=$1
DATE=`date +%s`
BRANCH=$2
CONFIG_DIR=$3
ST2_ACTIONS_DIR=$4
OUTPUT=/tmp/mistral-install-output-$DATE

touch $OUTPUT

if [[ ! -d "$REPO" ]]
then
  echo "ERROR: repo ${REPO} doesn't exist."
  exit 1
fi

cd $REPO

install_mistral() {
    # XXX: Ideally these steps should be actions of their own workflow.
    virtualenv --no-site-packages .venv
    if [[ $? != 0 ]]
    then
        echo 'Failed creating virtualenv'
        exit 2
    else
        . $REPO/.venv/bin/activate
    fi

    git checkout -q -b ${BRANCH} origin/${BRANCH}
    pip install -r requirements.txt >> $OUTPUT
    if [[ $? != 0 ]]
    then
        echo "Failed installing pip requirements for branch: $BRANCH"
        exit 3
    fi

    pip install -q mysql-python
    if [[ $? != 0 ]]<commit_msg>Temporary fix YAQL dependency for Mistral install<commit_after>#!/bin/bash

PYTHON=`which python`
REPO=$1
DATE=`date +%s`
BRANCH=$2
CONFIG_DIR=$3
ST2_ACTIONS_DIR=$4
OUTPUT=/tmp/mistral-install-output-$DATE

touch $OUTPUT

if [[ ! -d "$REPO" ]]
then
  echo "ERROR: repo ${REPO} doesn't exist."
  exit 1
fi

cd $REPO

install_mistral() {
    # XXX: Ideally these steps should be actions of their own workflow.
    virtualenv --no-site-packages .venv
    if [[ $? != 0 ]]
    then
        echo 'Failed creating virtualenv'
        exit 2
    else
        . $REPO/.venv/bin/activate
    fi

    git checkout -q -b ${BRANCH} origin/${BRANCH}
    pip install -r requirements.txt >> $OUTPUT
    if [[ $? != 0 ]]
    then
        echo "Failed installing pip requirements for branch: $BRANCH"
        exit 3
    fi

    # Temporary hack to bypass conflict in pbr version.
    VENV_PKG_DIR="$REPO/.venv/local/lib/python2.7/site-packages"
    YAQL_REQ_FILE="$VENV_PKG_DIR/yaql-0.2.7-py2.7.egg-info/requires.txt"
    if [[ -f "${YAQL_REQ_FILE}" ]]; then
        sed -i 's/pbr>=0.6,!=0.7,<1.0/pbr<2.0,>=0.11/g' ${YAQL_REQ_FILE}
    fi

    pip install -q mysql-python
    if [[ $? != 0 ]]
{'fraction_non_alphanumeric': 0.14414414414414414, 'fraction_numerical': 0.02002002002002002, 'mean_word_length': 2.6148282097649185, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '7383157', 'n_tokens_mistral': 777, 'n_tokens_neox': 730, 'n_words': 195}