<commit_before>#!/bin/bash

PATH_SELF=$( cd "$( dirname "$0" )" && pwd )
source $PATH_SELF/variables.sh

cmd () {
    echo "[RUN] $1"
    eval $1
    if [ $? -ne 0 ]; then
        exit $?
    fi
}

cd $PROJECT_DIR

if [ ! -f $PYENV_DIR/bin/activate ]; then
    cmd "rm -rfv $PYENV_DIR"
    cmd "virtualenv $PYENV_DIR"
fi

cmd "source $PYENV_DIR/bin/activate"
cmd "pip install coverage mock stdeb nose"
cmd "python setup.py install"
cmd "nosetests --verbose --with-coverage --cover-html --cover-html-dir=$COVERAGE_HTML_DIR --cover-package=psistats --cover-xml --cover-xml-dir=$COVERAGE_XML_DIR --with-xunit --xunit-file=$COVERAGE_DIR/xunit.xml -d"
cmd "python setup.py test"
cmd "python setup.py coverage --branch --erase --html-dir=$COVERAGE_HTML_DIR --xml-dir=$COVERAGE_XML_DIR --annotations-dir=$COVERAGE_ANNOTATIONS_DIR"
cmd "python setup.py sdist --dist-dir=$DIST_DIR"

cd $DIST_DIR
cmd "tar -xzvf ${ARTIFACT_ID}-${VERSION}.tar.gz"

SRC_DIR=$DIST_DIR/${ARTIFACT_ID}-${VERSION}
cd $SRC_DIR
cmd "python setup.py --command-packages=stdeb.command sdist_dsc --extra-cfg-file=$DEBIAN_CFG_DIR/configs/debian.cfg --debian-version=$BUILD_NUMBER --package=$ARTIFACT_ID"

DEBDIST_DIR=$SRC_DIR/deb_dist
DEBIAN_DIR=$DEBDIST_DIR/$ARTIFACT_ID-$VERSION/debian
DEB_FILE=${ARTIFACT_ID}_${VERSION}-${BUILD_NUMBER}_all.deb
cmd "sed -i -e 's/python-all (>= 2.6.6-3), //g' $DEBDIST_DIR/${ARTIFACT_ID}_${VERSION}-${BUILD_NUMBER}.dsc"

cmd "cp $DEBIAN_CFG_DIR/postinst $DEBIAN_DIR/postinst"
cmd "cp $DEBIAN_CFG_DIR/postrm $DEBIAN_DIR/postrm"<commit_msg>Fixed bug with coverage reports Removed the old setup.py comments for testing/coverage as this is replaced with nosetest now.<commit_after>#!/bin/bash

PATH_SELF=$( cd "$( dirname "$0" )" && pwd )
source $PATH_SELF/variables.sh

cmd () {
    echo "[RUN] $1"
    eval $1
    if [ $? -ne 0 ]; then
        exit $?
    fi
}

cd $PROJECT_DIR

if [ ! -f $PYENV_DIR/bin/activate ]; then
    cmd "rm -rfv $PYENV_DIR"
    cmd "virtualenv $PYENV_DIR"
fi

cmd "source $PYENV_DIR/bin/activate"
cmd "pip install coverage mock stdeb nose"
cmd "python setup.py install"
cmd "nosetests --verbose --with-coverage --cover-html --cover-html-dir=$COVERAGE_HTML_DIR --cover-package=psistats --cover-xml --cover-xml-file=$COVERAGE_XML_DIR/coverage.xml --with-xunit --xunit-file=$COVERAGE_DIR/xunit.xml -d"
cmd "python setup.py sdist --dist-dir=$DIST_DIR"

cd $DIST_DIR
cmd "tar -xzvf ${ARTIFACT_ID}-${VERSION}.tar.gz"

SRC_DIR=$DIST_DIR/${ARTIFACT_ID}-${VERSION}
cd $SRC_DIR
cmd "python setup.py --command-packages=stdeb.command sdist_dsc --extra-cfg-file=$DEBIAN_CFG_DIR/configs/debian.cfg --debian-version=$BUILD_NUMBER --package=$ARTIFACT_ID"

DEBDIST_DIR=$SRC_DIR/deb_dist
DEBIAN_DIR=$DEBDIST_DIR/$ARTIFACT_ID-$VERSION/debian
DEB_FILE=${ARTIFACT_ID}_${VERSION}-${BUILD_NUMBER}_all.deb
cmd "sed -i -e 's/python-all (>= 2.6.6-3), //g' $DEBDIST_DIR/${ARTIFACT_ID}_${VERSION}-${BUILD_NUMBER}.dsc"

cmd "cp $DEBIAN_CFG_DIR/postinst $DEBIAN_DIR/postinst"
cmd "cp $DEBIAN_CFG_DIR/postrm $DEBIAN_DIR/postrm"
{'fraction_non_alphanumeric': 0.16318407960199005, 'fraction_numerical': 0.005306799336650083, 'mean_word_length': 4.5036496350364965, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 8}, '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': '2923324', 'n_tokens_mistral': 1237, 'n_tokens_neox': 1186, 'n_words': 232}