Support for using virtualenv for better side-by-side deps
This commit is contained in:
parent
58783a53aa
commit
c59307c6d1
|
@ -50,6 +50,7 @@ npm-debug.log
|
|||
# ==============================================================================
|
||||
|
||||
# Python
|
||||
local_virtualenv/
|
||||
*.egg-info
|
||||
build/
|
||||
dist/
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Copyright 2012 Google Inc. All Rights Reserved.
|
||||
|
||||
# Runs the local virtualenv copy of anvil instead of the global one.
|
||||
# Requires that things be setup with ./setup-local.sh (which this will attempt
|
||||
# to invoke if it notices things not quite right).
|
||||
|
||||
|
||||
# Check to see if setup.
|
||||
if [ ! -d "local_virtualenv" ]; then
|
||||
echo "Missing local virtualenv - setting up..."
|
||||
./setup-local.sh
|
||||
fi
|
||||
|
||||
|
||||
source local_virtualenv/bin/activate
|
||||
python anvil/manage.py "$@"
|
|
@ -0,0 +1,30 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Copyright 2012 Google Inc. All Rights Reserved.
|
||||
|
||||
# Sets up a local virtualenv for anvil.
|
||||
# This places all dependencies within the anvil-build/ path such that nothing
|
||||
# from site-packages is used. In order to make use of this consumers should
|
||||
# invoke anvil-local.sh instead of the global 'anvil'.
|
||||
|
||||
|
||||
# Ensure virtualenv is present.
|
||||
if [ ! -e "$(which virtualenv)" ]; then
|
||||
echo "virtualenv not found - installing..."
|
||||
if [ -e "$(which pip)" ]; then
|
||||
sudo pip install virtualenv
|
||||
elif [-e "$(which easyinstall)" ]; then
|
||||
sudo easy_install virtualenv
|
||||
else
|
||||
echo "No python package installer found - aborting"
|
||||
echo "(get pip or easy_install)"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# Setup the virtual environment.
|
||||
/usr/local/lib/python2.6/dist-packages/virtualenv-1.8.2-py2.6.egg/virtualenv.py local_virtualenv
|
||||
|
||||
# Install there.
|
||||
source local_virtualenv/bin/activate
|
||||
python setup.py develop
|
Loading…
Reference in New Issue