coverage.py / build_ve.sh

#!/usr/bin/env bash
#
# Create virtualenvs needed to test coverage.
# Invoke with command args, a list of python installations to make virtualenvs
# from.  COVERAGE_VE should point to the directory to hold them. For example:
#
#   COVERAGE_VE=../ve ./build_ve.sh /opt/python*
#

ve=${COVERAGE_VE:-../ve}

echo "Constructing virtualenvs in $ve"

rm -rf $ve
mkdir $ve

for p in $*
do
    echo --- $p -------------------------
    if [ -f $p/bin/python ]; then
        suff=
    elif [ -f $p/bin/python3 ]; then
        suff=3
    else
        echo "*** There's no Python in $p"
        exit
    fi

    # Figure out what version we are
    ver=`$p/bin/python$suff -c "import sys; print('%s%s' % sys.version_info[:2])"`
    echo The version is $ver

    # Make the virtualenv
    $p/bin/virtualenv $ve/$ver

    # Activate the virtualenv
    source $ve/$ver/bin/activate

    # Install nose
    easy_install nose

    # Write the .pth file that lets us import our test zips.
    libdir=`echo $ve/$ver/lib/python*/site-packages/`
    echo `pwd`/test/eggsrc/dist/covtestegg1-0.0.0-py2.6.egg > $libdir/coverage_test_egg.pth

    # Install ourselves
    python setup.py develop
done
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.