Skip to content
Snippets Groups Projects
Commit cd01dc0c authored by Kenneth Reitz's avatar Kenneth Reitz
Browse files

activate and utilize virtualenv.

Export PIP_DOWNLOAD_CACHE
parent 2750238a
No related branches found
No related tags found
No related merge requests found
...@@ -13,6 +13,8 @@ PIP_DOWNLOAD_CACHE=${PIP_DOWNLOAD_CACHE:-$CACHE_DIR/pip_downloads} ...@@ -13,6 +13,8 @@ PIP_DOWNLOAD_CACHE=${PIP_DOWNLOAD_CACHE:-$CACHE_DIR/pip_downloads}
VIRTUALENV_DIRS="bin include lib" VIRTUALENV_DIRS="bin include lib"
VENDORED_MEMCACHED="http://cl.ly/0a191R3K160t1w1P0N25/vendor-libmemcached.tar.gz" VENDORED_MEMCACHED="http://cl.ly/0a191R3K160t1w1P0N25/vendor-libmemcached.tar.gz"
export PIP_DOWNLOAD_CACHE
indent() { indent() {
RE="s/^/ /" RE="s/^/ /"
[ $(uname) == "Darwin" ] && sed -l "$RE" || sed -u "$RE" [ $(uname) == "Darwin" ] && sed -l "$RE" || sed -u "$RE"
...@@ -93,6 +95,8 @@ if [ "$NAME" = "Python/Django" ]; then ...@@ -93,6 +95,8 @@ if [ "$NAME" = "Python/Django" ]; then
import os import os
import sys import sys
import urlparse import urlparse
# Register database schemes in URLs.
urlparse.uses_netloc.append('postgres') urlparse.uses_netloc.append('postgres')
urlparse.uses_netloc.append('mysql') urlparse.uses_netloc.append('mysql')
...@@ -129,13 +133,16 @@ except Exception: ...@@ -129,13 +133,16 @@ except Exception:
EOF EOF
fi fi
echo "-----> Activating virtualenv"
source bin/activate
if (grep -Fiq "hg+" requirements.txt) then if (grep -Fiq "hg+" requirements.txt) then
PIP_DOWNLOAD_CACHE=$PIP_DOWNLOAD_CACHE bin/pip install --use-mirrors mercurial | indent pip install --use-mirrors mercurial | indent
source bin/activate
fi fi
echo "-----> Installing dependencies using pip version $(bin/pip --version | awk '{print $2}')" echo "-----> Installing dependencies using pip version $(bin/pip --version | awk '{print $2}')"
PIP_DOWNLOAD_CACHE=$PIP_DOWNLOAD_CACHE bin/pip install --use-mirrors -r requirements.txt | indent pip install --use-mirrors -r requirements.txt | indent
set +e set +e
OUT=$(virtualenv --relocatable .) OUT=$(virtualenv --relocatable .)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment