always use python3 for bootstrapping tox environment unless the tox-env
contains "py2" but not "py3"
Signed-off-by: Kefu Chai <kchai@redhat.com>
echo "$PWD already exists, but it's not a virtualenv. test_name empty?"
exit 1
fi
- $source_dir/src/tools/setup-virtualenv.sh ${venv_path}
+ # try to use the prefered python for creating the virtual env for
+ # bootstrapping tox.
+ case $tox_envs in
+ py3*)
+ virtualenv_python=python3;;
+ py2*)
+ virtualenv_python=python2;;
+ *)
+ virtualenv_python=python3;;
+ esac
+ $source_dir/src/tools/setup-virtualenv.sh --python=${virtualenv_python} ${venv_path}
fi
source ${venv_path}/bin/activate
pip install tox