Skip to content

Commit fdac18b

Browse files
mayeutjcfr
andcommitted
ci: Fix macOS on TravisCI
This commit fixes macOS continuous integration applying the following changes: * remove the use of brew/pyenv * install official python distribution - update from 2.7.15 to 2.7.18 - udpate from 3.7.8 to 3.7.9 * install certifi using script from cibuildwheel * create a virtual environment in ~/.pyenv/versions/${PYTHON_VERSION} sub-directory For reference, this commit also reverts the following commits: * 28b0d4b (ci: Update travis to fix "libintl" loading error) * 0be7aea (ci: Fix macOS build using pip2 instead of pip) * 6ec58d7 (ci: Tweak cache and before_cache steps) See scikit-build#129 Co-authored-by: Jean-Christophe Fillion-Robin <[email protected]>
1 parent 67e5715 commit fdac18b

File tree

2 files changed

+22
-25
lines changed

2 files changed

+22
-25
lines changed

.travis.yml

+22-24
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
@@ -25,39 +25,37 @@ matrix:
2525
dist: focal
2626
language: generic
2727

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

3629
cache:
3730
directories:
38-
# Cache downloaded bottles
39-
- $HOME/Library/Caches/Homebrew
40-
# pyenv
41-
- $HOME/.pyenv_cache
42-
- $HOME/.pyenv/versions/3.7.8
43-
- $HOME/.pyenv/versions/2.7.15
4431
# scikit-ci-addons
4532
- $HOME/downloads
4633

4734
before_install:
4835
- |
49-
# Workaround the following error occuring because python installation is cached but gettext dependency is not
50-
# dyld: Library not loaded: /usr/local/opt/gettext/lib/libintl.8.dylib
51-
# Referenced from: /Users/travis/.pyenv/versions/3.7.2/bin/python
52-
# Reason: Incompatible library version: python requires version 11.0.0 or later, but libintl.8.dylib provides version 10.0.0
53-
if [[ "$TRAVIS_OS_NAME" == "osx" && "${PYTHON_VERSION}" == "3.7.8" ]]; then
54-
brew install gettext
36+
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
37+
# Install official python distribution
38+
curl -fsSLo /tmp/Python.pkg "https://www.python.org/ftp/python/${PYTHON_VERSION}/python-${PYTHON_VERSION}-macosx10.9.pkg"
39+
sudo installer -pkg /tmp/Python.pkg -target /
40+
PYTHON_VERSION2=${PYTHON_VERSION%.*}
41+
PYTHON_VERSION1=${PYTHON_VERSION2%.*}
42+
python_executable=/Library/Frameworks/Python.framework/Versions/${PYTHON_VERSION2}/bin/python${PYTHON_VERSION1}
43+
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+
49+
# Install packages
50+
${python_executable} -m pip install --disable-pip-version-check --upgrade pip
51+
${python_executable} -m pip install virtualenv
52+
53+
# Create and activate virtual environment
54+
${python_executable} -m virtualenv ${HOME}/.pyenv/versions/${PYTHON_VERSION}
55+
source ${HOME}/.pyenv/versions/${PYTHON_VERSION}/bin/activate
5556
fi
5657
- |
5758
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
58-
mkdir $HOME/bin; ln -s $(which pip2) $HOME/bin/pip; ln -s $(which python2) $HOME/bin/python
59-
python scripts/ssl-check.py
60-
python -m pip install --disable-pip-version-check --upgrade pip
6159
pip install -U scikit-ci scikit-ci-addons
6260
ci_addons --install ../addons
6361
elif [[ "$TRAVIS_OS_NAME" == "linux" ]]; then

scikit-ci.yml

-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ before_install:
5353
PATH: $<HOME>/.pyenv/versions/$<PYTHON_VERSION>/bin:$<PATH>
5454
SETUP_BDIST_WHEEL_ARGS: --plat-name macosx-10.6-x86_64
5555
commands:
56-
- python ../addons/travis/install_pyenv.py
5756
- python scripts/ssl-check.py
5857
- python ../addons/travis/install_cmake.py 3.12.0
5958
linux:

0 commit comments

Comments
 (0)