Skip to content

Commit 169caee

Browse files
committed
Fix macOS build on travis-ci
1 parent f910815 commit 169caee

File tree

2 files changed

+19
-22
lines changed

2 files changed

+19
-22
lines changed

.travis.yml

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ matrix:
1111
- os: osx
1212
language: generic
1313
env:
14-
- PYTHON_VERSION=3.7.8
14+
- PYTHON_VERSION=3.7.9
1515

1616
- os: osx
1717
language: generic
1818
env:
19-
- PYTHON_VERSION=2.7.15
19+
- PYTHON_VERSION=2.7.18
2020

2121
- os: linux
2222
arch: arm64-graviton2
@@ -27,34 +27,33 @@ matrix:
2727
env:
2828
- PYTHON_VERSION=3.8.5
2929

30-
before_cache:
31-
# Cleanup to avoid the cache to grow indefinitely as new package versions are released
32-
# see https://stackoverflow.com/questions/39930171/cache-brew-builds-with-travis-ci
33-
- brew cleanup
34-
3530
cache:
3631
directories:
37-
# Cache downloaded bottles
38-
- $HOME/Library/Caches/Homebrew
39-
# pyenv
40-
- $HOME/.pyenv_cache
41-
- $HOME/.pyenv/versions/3.7.8
42-
- $HOME/.pyenv/versions/2.7.15
4332
# scikit-ci-addons
4433
- $HOME/downloads
4534

4635
before_install:
4736
- |
48-
# Workaround the following error occuring because python installation is cached but gettext dependency is not
49-
# dyld: Library not loaded: /usr/local/opt/gettext/lib/libintl.8.dylib
50-
# Referenced from: /Users/travis/.pyenv/versions/3.7.2/bin/python
51-
# Reason: Incompatible library version: python requires version 11.0.0 or later, but libintl.8.dylib provides version 10.0.0
52-
if [[ "$TRAVIS_OS_NAME" == "osx" && "${PYTHON_VERSION}" == "3.7.8" ]]; then
53-
brew install gettext
37+
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
38+
# Install official python distribution
39+
curl -fsSLo /tmp/Python.pkg "https://www.python.org/ftp/python/${PYTHON_VERSION}/python-${PYTHON_VERSION}-macosx10.9.pkg"
40+
sudo installer -pkg /tmp/Python.pkg -target /
41+
PYTHON_VERSION2=${PYTHON_VERSION%.*}
42+
PYTHON_VERSION1=${PYTHON_VERSION2%.*}
43+
python_executable=/Library/Frameworks/Python.framework/Versions/${PYTHON_VERSION2}/bin/python${PYTHON_VERSION1}
44+
# Install SSL certificates
45+
curl -fsSLo /tmp/install_certifi.py https://github.com/joerick/cibuildwheel/raw/v1.10.0/cibuildwheel/resources/install_certifi.py
46+
sudo ${python_executable} /tmp/install_certifi.py
47+
${python_executable} scripts/ssl-check.py
48+
# Install packages
49+
${python_executable} -m pip install --disable-pip-version-check --upgrade pip
50+
${python_executable} -m pip install virtualenv
51+
# Create and activate virtual environment
52+
${python_executable} -m virtualenv ${HOME}/.pyenv/versions/${PYTHON_VERSION}
53+
source ${HOME}/.pyenv/versions/${PYTHON_VERSION}/bin/activate
5454
fi
5555
- |
5656
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
57-
mkdir $HOME/bin; ln -s $(which pip2) $HOME/bin/pip; ln -s $(which python2) $HOME/bin/python;
5857
python -m pip install --disable-pip-version-check --upgrade pip
5958
pip install -U scikit-ci scikit-ci-addons
6059
ci_addons --install ../addons

scikit-ci.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ before_install:
1919
environment:
2020
PATH: $<HOME>/.pyenv/versions/$<PYTHON_VERSION>/bin:$<PATH>
2121
SETUP_BDIST_WHEEL_ARGS: --plat-name macosx-10.6-x86_64
22-
commands:
23-
- python ../addons/travis/install_pyenv.py
2422

2523
install:
2624
commands:

0 commit comments

Comments
 (0)