From 4945a2233363b496640e71a5f7bc0fd37d185592 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Wed, 4 Dec 2013 23:11:52 -0400 Subject: Add the ability to run the runner inside a virtualenv using virtualenvwrapper.sh --- pkg/tools/with_venvwrapper.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 pkg/tools/with_venvwrapper.sh (limited to 'pkg') diff --git a/pkg/tools/with_venvwrapper.sh b/pkg/tools/with_venvwrapper.sh new file mode 100755 index 00000000..988d2822 --- /dev/null +++ b/pkg/tools/with_venvwrapper.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +#Wraps a command in a virtualenwrapper passed as first argument. +#Example: +#with_virtualenvwrapper.sh leap-bitmask ./run_tests.sh + +alias pyver='python -c "import $1;print $1.__path__[0]; print $1.__version__;"' + +source `which virtualenvwrapper.sh` +workon $1 +echo "running version: " `pyver leap.bitmask` +$2 $3 $4 $5 -- cgit v1.2.3 From d7a7c886b06acbe3ff5e5abb3911fd4905432ca6 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Thu, 5 Dec 2013 10:00:27 -0400 Subject: change path to working directory, since we reuse venv across projects --- pkg/tools/with_venvwrapper.sh | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'pkg') diff --git a/pkg/tools/with_venvwrapper.sh b/pkg/tools/with_venvwrapper.sh index 988d2822..693c0ac9 100755 --- a/pkg/tools/with_venvwrapper.sh +++ b/pkg/tools/with_venvwrapper.sh @@ -4,9 +4,13 @@ #Example: #with_virtualenvwrapper.sh leap-bitmask ./run_tests.sh +wd=`pwd` alias pyver='python -c "import $1;print $1.__path__[0]; print $1.__version__;"' source `which virtualenvwrapper.sh` +echo "Activating virtualenv " $1 +echo "------------------------------------" workon $1 +cd $wd echo "running version: " `pyver leap.bitmask` $2 $3 $4 $5 -- cgit v1.2.3