Make virtuelenv testable

This commit is contained in:
Miro Hrončok 2018-07-20 12:26:14 +02:00
commit aa5f2fee63

View file

@ -3,12 +3,21 @@
# set python version # set python version
VERSION=${VERSION:-3.7} VERSION=${VERSION:-3.7}
PYTHON=python$VERSION PYTHON=python$VERSION
METHOD=${METHOD:-venv}
# clean from possible older runs # clean from possible older runs
rm -rf venv .tox __pycache__ .pytest* test_*.py *.pyx *.c *.so || : rm -rf venv .tox __pycache__ .pytest* test_*.py *.pyx *.c *.so || :
# check the we can create the venv # check the we can create the venv
$PYTHON -m venv venv if [ "$METHOD" == "venv" ]; then
$PYTHON -m venv venv
elif [ "$METHOD" == "virtualenv" ]; then
virtualenv --python=$PYTHON venv
else
echo 'Unsupported $METHOD' $METHOD >&2
exit 1
fi
# and activate it # and activate it
# unset variables on 3.5, it's known # unset variables on 3.5, it's known