8000 BLD add a mac run on Travis (#12824) · NicolasHug/scikit-learn@951c4f1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 951c4f1

Browse files
jnothmanogrisel
authored andcommitted
BLD add a mac run on Travis (scikit-learn#12824)
1 parent d011aed commit 951c4f1

File tree

3 files changed

+36
-22
lines changed

3 files changed

+36
-22
lines changed

.travis.yml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,14 @@ env:
2020

2121
matrix:
2222
include:
23-
# This environment tests that scikit-learn can be built against
23+
# Latest dependencies on macOS with MKL
24+
- env: DISTRIB="conda" PYTHON_VERSION="*" INSTALL_MKL="true"
25+
NUMPY_VERSION="*" SCIPY_VERSION="*" CYTHON_VERSION="*"
26+
PILLOW_VERSION="*" JOBLIB_VERSION="*" COVERAGE=true
27+
language: generic
28+
if: type != cron
29+
os: osx
30+
# Linux environment to test that scikit-learn can be built against
2431
# versions of numpy, scipy with ATLAS that comes with Ubuntu Xenial 16.04
2532
# i.e. numpy 1.11 and scipy 0.17
2633
- env: DISTRIB="ubuntu" PYTHON_VERSION="3.5"
@@ -36,18 +43,12 @@ matrix:
3643
- libatlas3-base
3744
- libatlas-base-dev
3845
- libatlas-dev
39-
# Python 3.5 build without SITE_JOBLIB
46+
# Linux + Python 3.5 build with OpenBLAS and without SITE_JOBLIB
4047
- env: DISTRIB="conda" PYTHON_VERSION="3.5" INSTALL_MKL="false"
4148
NUMPY_VERSION="1.11.0" SCIPY_VERSION="0.17.0" CYTHON_VERSION="*"
4249
PILLOW_VERSION="4.0.0" COVERAGE=true
4350
if: type != cron
44-
# Python 3.5 build
45-
- env: DISTRIB="conda" PYTHON_VERSION="3.5" INSTALL_MKL="false"
46-
NUMPY_VERSION="1.11.0" SCIPY_VERSION="0.17.0" CYTHON_VERSION="*"
47-
PILLOW_VERSION="4.0.0" COVERAGE=true
48-
SKLEARN_SITE_JOBLIB=1 JOBLIB_VERSION="0.11"
49-
if: type != cron
50-
# This environment tests the latest available dependencies.
51+
# Linux environment to test the latest available dependencies and MKL.
5152
# It runs tests requiring pandas and PyAMG.
5253
# It also runs with the site joblib instead of the vendored copy of joblib.
5354
- env: DISTRIB="conda" PYTHON_VERSION="*" INSTALL_MKL="true"
@@ -57,7 +58,7 @@ matrix:
5758
CHECK_PYTEST_SOFT_DEPENDENCY="true" TEST_DOCSTRINGS="true"
5859
SKLEARN_SITE_JOBLIB=1 CHECK_WARNINGS="true"
5960
if: type != cron
60-
# This environment tests scikit-learn against numpy and scipy master
61+
# Linux environment to test scikit-learn against numpy and scipy master
6162
# installed from their CI wheels in a virtualenv with the Python
6263
# interpreter provided by travis.
6364
- python: 3.7

build_tools/travis/after_success.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ if [[ "$COVERAGE" == "true" ]]; then
1010
# Need to run codecov from a git checkout, so we copy .coverage
1111
# from TEST_DIR where pytest has been run
1212
cp $TEST_DIR/.coverage $TRAVIS_BUILD_DIR
13-
cd $TRAVIS_BUILD_DIR
13+
1414
# Ignore codecov failures as the codecov server is not
1515
# very reliable but we don't want travis to report a failure
1616
# in the github UI just because the coverage report failed to
1717
# be published.
18-
codecov || echo "codecov upload failed"
18+
codecov --root $TRAVIS_BUILD_DIR || echo "codecov upload failed"
1919
fi

build_tools/travis/install.sh

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,33 @@ echo 'List files from cached directories'
1717
echo 'pip:'
1818
ls $HOME/.cache/pip
1919

20-
export CC=/usr/lib/ccache/gcc
21-
export CXX=/usr/lib/ccache/g++
22-
# Useful for debugging how ccache is used
23-
# export CCACHE_LOGFILE=/tmp/ccache.log
24-
# ~60M is used by .ccache when compiling from scratch at the time of writing
25-
ccache --max-size 100M --show-stats
20+
if [ $TRAVIS_OS_NAME = "linux" ]
21+
then
22+
export CC=/usr/lib/ccache/gcc
23+
export CXX=/usr/lib/ccache/g++
24+
# Useful for debugging how ccache is used
25+
# export CCACHE_LOGFILE=/tmp/ccache.log
26+
# ~60M is used by .ccache when compiling from scratch at the time of writing
27+
ccache --max-size 100M --show-stats
28+
fi
2629

2730
make_conda() {
2831
TO_INSTALL="$@"
2932
# Deactivate the travis-provided virtual environment and setup a
3033
# conda-based environment instead
31-
deactivate
34+
# If Travvis has language=generic, deactivate does not exist. `|| :` will pass.
35+
deactivate || :
3236

3337
# Install miniconda
34-
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh \
38+
if [ $TRAVIS_OS_NAME = "osx" ]
39+
then
40+
fname=Miniconda3-latest-MacOSX-x86_64.sh
41+
else
42+
fname=Miniconda3-latest-Linux-x86_64.sh
43+
fi
44+
wget https://repo.continuum.io/miniconda/$fname \
3545
-O miniconda.sh
36-
MINICONDA_PATH=/home/travis/miniconda
46+
MINICONDA_PATH=$HOME/miniconda
3747
chmod +x miniconda.sh && ./miniconda.sh -b -p $MINICONDA_PATH
3848
export PATH=$MINICONDA_PATH/bin:$PATH
3949
conda update --yes conda
@@ -115,6 +125,9 @@ except ImportError:
115125
pass
116126
"
117127
python setup.py develop
118-
ccache --show-stats
128+
if [ $TRAVIS_OS_NAME = "linux" ]
129+
then
130+
ccache --show-stats
131+
fi
119132
# Useful for debugging how ccache is used
120133
# cat $CCACHE_LOGFILE

0 commit comments

Comments
 (0)
0