Skip to content

Instantly share code, notes, and snippets.

@mkouhei
Last active August 29, 2015 14:21
Show Gist options
  • Save mkouhei/b2594f6e376b45ded415 to your computer and use it in GitHub Desktop.
Save mkouhei/b2594f6e376b45ded415 to your computer and use it in GitHub Desktop.
Create venv using pyvenv temporarily, because virtualenv of Sid is blocken at 20150522
#!/bin/sh -e
# You must install curl, python2, python3, python3-pyvenv in advance.
if [ -z $1 ]; then
echo 'input pyvenv directory' && read targetdir
else
targetdir=$1
fi
pyvenv --without-pip $targetdir
(
cd $targetdir
install -d lib/python2.7/site-packages
cwd=$(pwd)
sed -i "s:^\(home = \).*:\1${cwd}/bin:" pyvenv.cfg
(
cd bin
ln -sf /usr/bin/python2.7 python2.7
ln -sf python2.7 python2.7
binpath=$(pwd)
)
curl -O https://bootstrap.pypa.io/get-pip.py
. bin/activate
python get-pip.py --upgrade
pip install tox
)
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment