Fix macOS build

- Ensure python is available https://github.com/travis-ci/travis-ci/issues/2312
- Only pip install --user on linux, macOS is in virtualenv
- Set PATH in a os-agnostic manner https://github.com/huonw/travis-cargo/pull/71
This commit is contained in:
Christopher Durham 2017-12-02 21:26:09 -05:00
parent 24f1f69d5a
commit 4d84b1630b

View File

@ -20,8 +20,15 @@ addons:
before_script:
- |
pip install 'travis-cargo<0.2' --user &&
export PATH=$HOME/.local/bin:/usr/local/bin:$PATH
if [ $TRAVIS_OS_NAME = 'osx' ]; then
brew install python3
virtualenv env -p python3
source env/bin/activate
pip install 'travis-cargo<0.2'
else
pip install 'travis-cargo<0.2' --user
fi
- export PATH="$(python -m site --user-base)/bin:$PATH"
script:
- |