python travis2bash updates

- ignores things like "_with_system_site_packages"
- allows to skip python versions by using TRAVIS_PYTHON environment
  variable (set it to the desired python version to skip others)
This commit is contained in:
Peter Šurda 2021-02-14 08:49:16 +01:00
parent 0150d3abf2
commit 6d19239517
Signed by untrusted user: PeterSurda
GPG Key ID: 0C5F50C0B5F37D87

View File

@ -158,7 +158,12 @@ if [[ "$(declare -p travis_python)" =~ "declare -a" ]]; then
# strip quotes # strip quotes
temp="${pv%\"}" temp="${pv%\"}"
pv="${temp#\"}" pv="${temp#\"}"
# strip crap
pv=$(echo "$pv"|cut -d_ -f1)
ppath=/usr/bin/python$pv ppath=/usr/bin/python$pv
if [ -n "$TRAVIS_PYTHON" ] && [ "$TRAVIS_PYTHON" != "$pv" ]; then
echo "skipping python-$pv due to TRAVIS_PYTHON=$TRAVIS_PYTHON"
fi
#if [ ! -e "$ppath" ]; then #if [ ! -e "$ppath" ]; then
sudo apt -y install "python$pv" "python${pv}-dev" sudo apt -y install "python$pv" "python${pv}-dev"
#fi #fi