<commit_before>#!/bin/bash
# build script for apps that are packaged in isolation from a wrapping
# django project.

VIRTUALENV=../.venv
if [ -e "$VIRTUALENV" ]
then
    echo "Re-using existing virtualenv"
    . $VIRTUALENV/bin/activate
else
    virtualenv --no-site-packages $VIRTUALENV || { echo "Virtualenv failed"; exit -1; }
    . $VIRTUALENV/bin/activate
    easy_install -U setuptools
    easy_install pip
    rm -f ../md5.test_requirements.last
fi

md5sum src/test_requirements.txt > ../md5.test_requirements.new
diff ../md5.test_requirements.new ../md5.test_requirements.last
TEST_REQUIREMENTS_DIFF=$?

if [ "$TEST_REQUIREMENTS_DIFF" -ne 0 ]
then
    pip install --timeout 300 -r src/test_requirements.txt || { echo "pip failed (test_requirements)"; exit -1; }
    mv ../md5.test_requirements.new ../md5.test_requirements.last
fi

find src -name "*.pyc" -exec rm {} \;
coverage erase
PYTHONPATH=src coverage run --omit "*venv*,*test*,*migrations*,test_settings.py,settings.py,manage.py" src/runtests.py  || echo "Test failed"
coverage xml
coverage html
echo "Checking for PEP-8 violations"
pep8 --ignore=W293,E128,E501,E127 --exclude=migrations,manage.py,docs,assets,settings.py -r src > pep8.txt || echo "PEP-8 violations."
<commit_msg>fix that may deal with coverage!<commit_after>#!/bin/bash
# build script for apps that are packaged in isolation from a wrapping
# django project.

VIRTUALENV=../.venv
if [ -e "$VIRTUALENV" ]
then
    echo "Re-using existing virtualenv"
    . $VIRTUALENV/bin/activate
else
    virtualenv --no-site-packages $VIRTUALENV || { echo "Virtualenv failed"; exit -1; }
    . $VIRTUALENV/bin/activate
    easy_install -U setuptools
    easy_install pip
    rm -f ../md5.test_requirements.last
fi

md5sum src/test_requirements.txt > ../md5.test_requirements.new
diff ../md5.test_requirements.new ../md5.test_requirements.last
TEST_REQUIREMENTS_DIFF=$?

if [ "$TEST_REQUIREMENTS_DIFF" -ne 0 ]
then
    pip install --timeout 300 -r src/test_requirements.txt || { echo "pip failed (test_requirements)"; exit -1; }
    mv ../md5.test_requirements.new ../md5.test_requirements.last
fi

find src -name "*.pyc" -exec rm {} \;
coverage erase
PYTHONPATH=src coverage run --omit "*venv*,*migrations*,test_settings.py,settings.py,manage.py" src/runtests.py  || echo "Test failed"
coverage xml
coverage html
echo "Checking for PEP-8 violations"
pep8 --ignore=W293,E128,E501,E127 --exclude=migrations,manage.py,docs,assets,settings.py -r src > pep8.txt || echo "PEP-8 violations."

{'fraction_non_alphanumeric': 0.13338658146964857, 'fraction_numerical': 0.0231629392971246, 'mean_word_length': 3.9311023622047245, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '2379389', 'n_tokens_mistral': 950, 'n_tokens_neox': 880, 'n_words': 219}