tobiko/tools/ci/tox
Federico Ressi a880634a6f Automatically select python version on scenario and fucntional tests
Change-Id: I6da8e7fd15f913758c562bcc5aa7baca6a9692a2
2019-05-27 06:20:27 +02:00

24 lines
557 B
Bash
Executable File

#!/bin/bash
set -eux
# Prefer python3 on python2
PYTHON=$(which python3 || which python)
# Create a virtualenv for executing Tox and activate it
BASE_VIRTUALENV_DIR=.tox/base
if ! [ -d "${BASE_VIRTUALENV_DIR}" ]; then
"${PYTHON}" -m virtualenv "${BASE_VIRTUALENV_DIR}"
set +eux
source "${BASE_VIRTUALENV_DIR}/bin/activate"
set -eux
curl https://bootstrap.pypa.io/get-pip.py | python
pip install --upgrade setuptools wheel virtualenv tox
else
set +eux
source "${BASE_VIRTUALENV_DIR}/bin/activate"
set -eux
fi
tox "$*"