-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathbuild_venv.sh
More file actions
executable file
·50 lines (42 loc) · 922 Bytes
/
build_venv.sh
File metadata and controls
executable file
·50 lines (42 loc) · 922 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
PYPY_VERSION="2.2.1"
CURDIR=$(pwd)
ENV_DIR=${CURDIR}/flow_env
echo $ENV_DIR
if [ $(uname) == Darwin ]; then
DIST=osx64
else
DIST=linux64
fi
ARCHIVE="pypy-${PYPY_VERSION}-${DIST}.tar.bz2"
# Download PyPy distributin into tempdir
cd $TMPDIR
echo -n "Downloading PyPy...."
STATUS=$(curl -s -w "%{http_code}" -LO https://bitbucket.org/pypy/pypy/downloads/${ARCHIVE})
if [ $STATUS -ne 200 ]; then
echo "ERROR"
exit 1
else
echo "OK"
fi
echo -n "Extracting PyPy..."
tar -xf $ARCHIVE
if [ $? -ne 0 ]; then
echo "ERROR"
exit 1
else
echo "OK"
fi
PYPYEXEC=${TMPDIR}pypy-${PYPY_VERSION}-${DIST}/bin/pypy
if [ ! -x $PYPYEXEC ]; then
echo "pypy is missing"
exit 1
fi
cd $CURDIR
# Prepare virtual env
mkdir -p $ENV_DIR
cd $ENV_DIR
echo "Creating virtualenv"
virtualenv --no-site-packages -p $PYPYEXEC pypy-env
echo "Activate virtualenv"
source ${ENV_DIR}/pypy-env/bin/activate