diff options
author | Thomas Kriechbaumer <thomas@kriechbaumer.name> | 2016-05-25 19:42:22 +0200 |
---|---|---|
committer | Thomas Kriechbaumer <thomas@kriechbaumer.name> | 2016-05-25 20:42:42 +0200 |
commit | b0c90cc64f5090e762ba424a5f7aa57a22470d73 (patch) | |
tree | 1e441c3708eb341e69a50a21c9db6fbb83f873f5 /dev.sh | |
parent | ebaad914843c3cf045f209c1d51d5fc99b1d5edb (diff) | |
download | mitmproxy-b0c90cc64f5090e762ba424a5f7aa57a22470d73.tar.gz mitmproxy-b0c90cc64f5090e762ba424a5f7aa57a22470d73.tar.bz2 mitmproxy-b0c90cc64f5090e762ba424a5f7aa57a22470d73.zip |
add a py3 venv in dev environment
This allows us to run e.g. tests in a different python version:
$ venv3/bin/py.test test/netlib/test_tcp.py
Diffstat (limited to 'dev.sh')
-rwxr-xr-x | dev.sh | 30 |
1 files changed, 23 insertions, 7 deletions
@@ -1,13 +1,29 @@ -#!/bin/bash +#!/bin/sh set -e -VENV=./venv + +VENV="./venv" +VENV3="${VENV}3" python -m virtualenv $VENV --always-copy . $VENV/bin/activate -pip install -U pip setuptools -pip install -r requirements.txt +pip install -q -U pip setuptools +pip install -q -r requirements.txt echo "" -echo "* Created virtualenv environment in $VENV." -echo "* Installed all dependencies into the virtualenv." -echo "* You can now activate the virtualenv: \`. $VENV/bin/activate\`" +echo "* Virtualenv created in $VENV and all dependencies installed." +echo "* You can now activate the $(python --version) virtualenv with this command: \`. $VENV/bin/activate\`" + +if $(python --version 2>&1 | grep -q "Python 2.") && command -v python3 >/dev/null 2>&1; then + echo "" + echo "" + + python3 -m virtualenv "$VENV3" --always-copy + . "$VENV3/bin/activate" + pip install -q -U pip setuptools + pip install -q -r requirements.txt + + echo "" + echo "* Virtualenv created in $VENV3 and all dependencies installed." + echo "* You can now activate the $(python --version) virtualenv with this command: \`. $VENV3/bin/activate\`" +fi + |