eyeD3 / mkenv.sh

#!/bin/bash

_PYTHON=${2:-python2.7}
_PYTHON_VERSION=$($_PYTHON -c 'import sys; print ".".join([str(v) for v in sys.version_info[:2]])')
_ENV=${1:-eyeD3-${_PYTHON_VERSION}}

source /usr/bin/virtualenvwrapper.sh

mkvirtualenv -a $(pwd) --python=${_PYTHON} --distribute ${_ENV}
workon $_ENV

# FIXME
PKGS_OPTS=
if test -d ./.pip-download-cache; then
    export PIP_DOWNLOAD_CACHE=./.pip-download-cache    
fi

if test $_PYTHON_VERSION = "2.6"; then
    pip install $PKG_OPTS -r requirements-26.txt
    pip install $PKG_OPTS -r dev-requirements-26.txt
else
    pip install $PKG_OPTS -r dev-requirements.txt
fi

cat /dev/null >| $VIRTUAL_ENV/bin/postactivate
echo "alias cd-top=\"cd $PWD\"" >> $VIRTUAL_ENV/bin/postactivate
echo "export PATH=\"$PWD/bin:$PATH\"" >> $VIRTUAL_ENV/bin/postactivate
echo "export PYTHONPATH=\"$PWD/src\"" >> $VIRTUAL_ENV/bin/postactivate

cat /dev/null >| $VIRTUAL_ENV/bin/postdeactivate
echo "unalias cd-top" >> $VIRTUAL_ENV/bin/postdeactivate
# The changes to PATH are handled by normal deactivate
# Changes to PYTHONPATH are not undone, yet.
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.