Skip to content

Commit

Permalink
Travis: Fix OS-X virtualenv issue; Reduce coveralls.
Browse files Browse the repository at this point in the history
Details:
- This change fixes the issue that Travis runs on OS-X fail with
  an incorrect python version referenced in the hashbang of
  the virtualenv command. It also fixes an incorrect python
  version that was used on OS-X.
- This change also reduces the coveralls runs to only be run
  in one combination (py27 on linux with latest package level).

Signed-off-by: Andreas Maier <maiera@de.ibm.com>
  • Loading branch information
andy-maier committed Mar 21, 2018
1 parent 9b988d8 commit 7287d4e
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,19 +147,35 @@ install:
echo "PIP_CMD=$PIP_CMD"
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
if [[ "${PYTHON:0:1}" == "2" ]]; then
OSX_PYTHON_PKG=python;
OSX_PYTHON_PKG=python@2;
else
OSX_PYTHON_PKG=python3;
OSX_PYTHON_PKG=python;
fi;
echo "OSX_PYTHON_PKG=$OSX_PYTHON_PKG";
fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
brew update;
fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
brew search python && brew ls --versions $OSX_PYTHON_PKG && brew upgrade $OSX_PYTHON_PKG || brew install $OSX_PYTHON_PKG;
brew ls --versions $OSX_PYTHON_PKG;
rc=$?;
if [[ $rc == 0 ]]; then
echo "Upgrading $OSX_PYTHON_PKG";
brew upgrade $OSX_PYTHON_PKG;
else
echo "Installing $OSX_PYTHON_PKG";
brew install $OSX_PYTHON_PKG;
fi;
echo "Unlinking $OSX_PYTHON_PKG";
brew unlink $OSX_PYTHON_PKG;
echo "Linking $OSX_PYTHON_PKG";
brew link --overwrite $OSX_PYTHON_PKG;
$PIP_CMD install --upgrade pip setuptools;
echo "Checking Python and Pip";
which $PYTHON_CMD && which $PIP_CMD;
fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
$PIP_CMD install virtualenv;
virtualenv $HOME/venv -p $PYTHON_CMD && source $HOME/venv/bin/activate;
fi
- env |sort
Expand Down Expand Up @@ -195,4 +211,6 @@ script:
- make test

after_success:
- if [[ -z $_MANUAL_CI_RUN && $TRAVIS_PYTHON_VERSION == 2.7 ]]; then coveralls; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" && "$TRAVIS_PYTHON_VERSION" == "2.7" && "$PACKAGE_LEVEL" == "latest" && -z $_MANUAL_CI_RUN ]]; then
coveralls;
fi

0 comments on commit 7287d4e

Please sign in to comment.