Skip to content

Commit

Permalink
add a py3 venv in dev environment
Browse files Browse the repository at this point in the history
This allows us to run e.g. tests in a different python version:
$ venv3/bin/py.test test/netlib/test_tcp.py
  • Loading branch information
Kriechi committed May 25, 2016
1 parent ebaad91 commit b0c90cc
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
MANIFEST
*/tmp
/venv
/venv3
*.py[cdo]
*.swp
*.swo
Expand Down
30 changes: 23 additions & 7 deletions dev.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit b0c90cc

Please sign in to comment.