Make virtuelenv testable
This commit is contained in:
parent
a6067a8820
commit
aa5f2fee63
1 changed files with 10 additions and 1 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue