From 456a458e8672c3a7599e6913a7f9f0f6583eaec8 Mon Sep 17 00:00:00 2001 From: Peter Surda Date: Sun, 14 Feb 2021 11:41:17 +0100 Subject: [PATCH] Add _with_* support to travis python --- travis2bash.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/travis2bash.sh b/travis2bash.sh index 1a55f09..1a3ec72 100755 --- a/travis2bash.sh +++ b/travis2bash.sh @@ -80,9 +80,9 @@ function aptinstall() { function virtualenv_init() { # init virtualenv directory - if [ -n "$1" -a -n "$2" ]; then + if [ -n "$1" ] && [ -n "$2" ]; then echo -e "\nvirtualenv -p \"$1\" ~/.venv-$2\n" - virtualenv -p "$1" ~/.venv-"$2" + virtualenv -p "$1" "$3" ~/.venv-"$2" else echo -e "\nvirtualenv ~/.venv\n" virtualenv ~/.venv @@ -159,6 +159,10 @@ if [[ "$(declare -p travis_python)" =~ "declare -a" ]]; then temp="${pv%\"}" pv="${temp#\"}" # strip crap + options=$(echo "$pv"|cut -d_ -f2-) + if [[ "$options" == with* ]]; then + options="--$(echo "$options"|cut -d_ -f2-|tr -- '_' '-')" + fi pv=$(echo "$pv"|cut -d_ -f1) ppath=/usr/bin/python$pv if [ -n "$TRAVIS_PYTHON" ] && [ "$TRAVIS_PYTHON" != "$pv" ]; then @@ -168,7 +172,8 @@ if [[ "$(declare -p travis_python)" =~ "declare -a" ]]; then #if [ ! -e "$ppath" ]; then sudo apt -y install "python$pv" "python${pv}-dev" #fi - virtualenv_init "$ppath" "$pv" + + virtualenv_init "$ppath" "$pv" "$options" virtualenv_activate "$pv" python_run "$ppath" "$pv" deactivate