<commit_before>#!/bin/bash
# Install python2.7 virtualenv, install packages in requirements.txt.
#
# Set pip to cache downloads with environment variable:
#
#     export PIP_DOWNLOAD_CACHE=$HOME/.pip/cache

PYTHON=python2.7
PREFIX=$NIXD_OPT/$PYTHON

UNPACKED=virtualenv-1.9.1
ARCHIVE=$UNPACKED.tar.gz

REQUIREMENTS=$NIXD_ETC/$PYTHON-requirements.txt
PIP=$PREFIX/bin/pip

check() {
    nixd_ls $PREFIX/bin/python
    nixd_ls $PREFIX/bin/pip
    nixd_newer_than $REQUIREMENTS
}

resources() {
    echo https://pypi.python.org/packages/source/v/virtualenv/$ARCHIVE
}

pretest() {
    nixd check_for_program $PYTHON
    nixd_ls $REQUIREMENTS
}

install() {
    if [ ! -e $PREFIX/bin/python ]; then
        nixd_echo "Installing $PYTHON virtualenv."
        tar -xzf $ARCHIVE
        VIRTUALENV_PY=`pwd`/$UNPACKED/virtualenv.py
        nixd_echo "Ensuring virtualenv.py is unpacked ..."
        nixd_ls $VIRTUALENV_PY
        nixd_echo "Installing virtualenv to $PREFIX ..."
        cd $NIXD_OPT
        $PYTHON $VIRTUALENV_PY --distribute --no-site-packages $PYTHON
    fi
    nixd_echo "Installing packages listed in $REQUIREMENTS ..."
    $PIP install -r $REQUIREMENTS
}

nixd_run "$@"<commit_msg>Make requirements optional in python2.7 package.<commit_after>#!/bin/bash
# Install python2.7 virtualenv, install packages in requirements.txt.
#
# Set pip to cache downloads with environment variable:
#
#     export PIP_DOWNLOAD_CACHE=$HOME/.pip/cache

PYTHON=python2.7
PREFIX=$NIXD_OPT/$PYTHON

UNPACKED=virtualenv-1.11.4
ARCHIVE=$UNPACKED.tar.gz

REQUIREMENTS=$NIXD_ETC/$PYTHON-requirements.txt
PIP=$PREFIX/bin/pip

export PIP_DOWNLOAD_CACHE=${PIP_DOWNLOAD_CACHE-$NIXD_SRC}

check() {
    nixd_ls $PREFIX/bin/python
    nixd_ls $PREFIX/bin/pip
    if [ -e $REQUIREMENTS ]; then
        nixd_newer_than $REQUIREMENTS
    fi
}

resources() {
    echo https://pypi.python.org/packages/source/v/virtualenv/$ARCHIVE
}

pretest() {
    nixd check_for_program $PYTHON
}

install() {
    if [ ! -e $PREFIX/bin/python ]; then
        nixd_echo "Installing $PYTHON virtualenv."
        tar -xzf $ARCHIVE
        VIRTUALENV_PY=`pwd`/$UNPACKED/virtualenv.py
        nixd_echo "Ensuring virtualenv.py is unpacked ..."
        nixd_ls $VIRTUALENV_PY
        nixd_echo "Installing virtualenv to $PREFIX ..."
        cd $NIXD_OPT
        $PYTHON $VIRTUALENV_PY --distribute --no-site-packages $PYTHON
    fi
    if [ -e $REQUIREMENTS ]; then
        nixd_echo "Installing packages listed in $REQUIREMENTS ..."
        $PIP install -r $REQUIREMENTS
    fi
}

nixd_run "$@"
{'fraction_non_alphanumeric': 0.11555033294163729, 'fraction_numerical': 0.006658832745789268, 'mean_word_length': 3.228476821192053, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6108497', 'n_tokens_mistral': 985, 'n_tokens_neox': 927, 'n_words': 183}