Skip to content

Commit

Permalink
Try fixing macOS ci
Browse files Browse the repository at this point in the history
  • Loading branch information
mayeut committed Apr 7, 2021
1 parent 67e5715 commit 3fe179d
Showing 1 changed file with 12 additions and 22 deletions.
34 changes: 12 additions & 22 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ matrix:
- os: osx
language: generic
env:
- PYTHON_VERSION=3.7.8
- PYTHON_VERSION=3.7.9

- os: osx
language: generic
env:
- PYTHON_VERSION=2.7.15
- PYTHON_VERSION=2.7.18

- os: linux
arch: arm64-graviton2
Expand All @@ -25,37 +25,27 @@ matrix:
dist: focal
language: generic

before_cache:
# Cleanup to avoid the cache to grow indefinitely as new package versions are released
# see https://stackoverflow.com/questions/39930171/cache-brew-builds-with-travis-ci
- |
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
brew cleanup
fi

cache:
directories:
# Cache downloaded bottles
- $HOME/Library/Caches/Homebrew
# pyenv
- $HOME/.pyenv_cache
- $HOME/.pyenv/versions/3.7.8
- $HOME/.pyenv/versions/2.7.15
# scikit-ci-addons
- $HOME/downloads

before_install:
- |
# Workaround the following error occuring because python installation is cached but gettext dependency is not
# dyld: Library not loaded: /usr/local/opt/gettext/lib/libintl.8.dylib
# Referenced from: /Users/travis/.pyenv/versions/3.7.2/bin/python
# Reason: Incompatible library version: python requires version 11.0.0 or later, but libintl.8.dylib provides version 10.0.0
if [[ "$TRAVIS_OS_NAME" == "osx" && "${PYTHON_VERSION}" == "3.7.8" ]]; then
brew install gettext
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
curl -fsSLo /tmp/Python.pkg "https://www.python.org/ftp/python/${PYTHON_VERSION}/python-${PYTHON_VERSION}-macosx10.9.pkg"
sudo installer -pkg /tmp/Python.pkg -target /
PYTHON_VERSION2=${PYTHON_VERSION%.*}
PYTHON_VERSION1=${PYTHON_VERSION2%.*}
curl -fsSLo /tmp/install_certifi.py https://github.com/joerick/cibuildwheel/raw/v1.10.0/cibuildwheel/resources/install_certifi.py
sudo /Library/Frameworks/Python.framework/Versions/${PYTHON_VERSION2}/bin/python${PYTHON_VERSION1} /tmp/install_certifi.py
/Library/Frameworks/Python.framework/Versions/${PYTHON_VERSION2}/bin/python${PYTHON_VERSION1} -m pip install virtualenv
/Library/Frameworks/Python.framework/Versions/${PYTHON_VERSION2}/bin/python${PYTHON_VERSION1} -m virtualenv ${HOME}/.pyenv/versions/${PYTHON_VERSION}
source ${HOME}/.pyenv/versions/${PYTHON_VERSION}/bin/activate
fi
- |
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
mkdir $HOME/bin; ln -s $(which pip2) $HOME/bin/pip; ln -s $(which python2) $HOME/bin/python
python scripts/ssl-check.py
python -m pip install --disable-pip-version-check --upgrade pip
pip install -U scikit-ci scikit-ci-addons
Expand Down

0 comments on commit 3fe179d

Please sign in to comment.