Skip to content

Commit

Permalink
[CI] Fix macOS TravisCI builds
Browse files Browse the repository at this point in the history
Homebrew switched their default Python recipe to Python 3, so install
python@2 recipe. Also, directly specify which version of Python should
run SCons to prevent picking up the wrong version of Python as the
sys.executable.
  • Loading branch information
bryanwweber committed Mar 13, 2018
1 parent 6c4bc5b commit 742bfbc
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,27 @@ addons:
- libboost-dev
before_script: |
echo TRAVIS_OS_NAME: $TRAVIS_OS_NAME
pip2 install --user --install-option="--no-cython-compile" cython
pip2 install --user 3to2
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
brew update
brew install scons
brew update > /dev/null
brew upgrade python # Installs Python 3
brew install python@2 # Installs Python 2
brew install scons # Install SCons which *should* use Python 3
pip3 install numpy cython # Install numpy and Cython for Python 3
pip2 install numpy 3to2 # Install numpy and 3to2 for Python 2
brew install boost
brew install python3
pip3 install numpy
else
pip2 install --user --install-option="--no-cython-compile" cython
pip2 install --user 3to2
fi
rm -f cantera.conf
script: |
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
scons build -j2 VERBOSE=y python2_package=full python3_package=full python3_cmd=/usr/bin/python3 blas_lapack_libs=lapack,blas optimize=n coverage=y
scons test
else
scons build -j2 VERBOSE=y python2_package=full python3_package=full blas_lapack_libs=lapack,blas optimize=n coverage=y
python3 `which scons` build -j2 VERBOSE=y python2_package=full python3_package=full python2_cmd=/usr/local/opt/python@2/bin/python2 blas_lapack_libs=lapack,blas optimize=n coverage=y
python3 `which scons` test
fi
scons test
after_success: |
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
bash <(curl -s https://codecov.io/bash)
Expand Down

0 comments on commit 742bfbc

Please sign in to comment.