Skip to content

Commit 945d87c

Browse files
jeremiedbbglemaitre
authored andcommitted
MAINT clean travis install (scikit-learn#15041)
1 parent 186629b commit 945d87c

File tree

2 files changed

+39
-119
lines changed

2 files changed

+39
-119
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ matrix:
2222
# installed from their CI wheels in a virtualenv with the Python
2323
# interpreter provided by travis.
2424
- python: 3.7
25-
env: DISTRIB="scipy-dev" CHECK_WARNINGS="true"
25+
env: CHECK_WARNINGS="true"
2626
if: type = cron OR commit_message =~ /\[scipy-dev\]/
2727

2828
install: source build_tools/travis/install.sh

build_tools/travis/install.sh

+38-118
Original file line numberDiff line numberDiff line change
@@ -16,133 +16,53 @@ set -e
1616
# Fail fast
1717
build_tools/travis/travis_fastfail.sh
1818

19-
echo 'List files from cached directories'
20-
echo 'pip:'
19+
echo "List files from cached directories"
20+
echo "pip:"
2121
ls $HOME/.cache/pip
2222

23-
if [ $TRAVIS_OS_NAME = "linux" ]
24-
then
25-
export CC=/usr/lib/ccache/gcc
26-
export CXX=/usr/lib/ccache/g++
27-
# Useful for debugging how ccache is used
28-
# export CCACHE_LOGFILE=/tmp/ccache.log
29-
# ~60M is used by .ccache when compiling from scratch at the time of writing
30-
ccache --max-size 100M --show-stats
31-
elif [ $TRAVIS_OS_NAME = "osx" ]
32-
then
33-
# enable OpenMP support for Apple-clang
34-
export CC=/usr/bin/clang
35-
export CXX=/usr/bin/clang++
36-
export CPPFLAGS="$CPPFLAGS -Xpreprocessor -fopenmp"
37-
export CFLAGS="$CFLAGS -I/usr/local/opt/libomp/include"
38-
export CXXFLAGS="$CXXFLAGS -I/usr/local/opt/libomp/include"
39-
export LDFLAGS="$LDFLAGS -L/usr/local/opt/libomp/lib -lomp"
40-
export DYLD_LIBRARY_PATH=/usr/local/opt/libomp/lib
41-
fi
42-
43-
make_conda() {
44-
TO_INSTALL="$@"
45-
# Deactivate the travis-provided virtual environment and setup a
46-
# conda-based environment instead
47-
# If Travvis has language=generic, deactivate does not exist. `|| :` will pass.
48-
deactivate || :
49-
50-
# Install miniconda
51-
if [ $TRAVIS_OS_NAME = "osx" ]
52-
then
53-
fname=Miniconda3-latest-MacOSX-x86_64.sh
54-
else
55-
fname=Miniconda3-latest-Linux-x86_64.sh
56-
fi
57-
wget https://repo.continuum.io/miniconda/$fname \
58-
-O miniconda.sh
59-
MINICONDA_PATH=$HOME/miniconda
60-
chmod +x miniconda.sh && ./miniconda.sh -b -p $MINICONDA_PATH
61-
export PATH=$MINICONDA_PATH/bin:$PATH
62-
conda update --yes conda
63-
64-
conda create -n testenv --yes $TO_INSTALL
65-
source activate testenv
66-
}
67-
68-
if [[ "$DISTRIB" == "conda" ]]; then
69-
TO_INSTALL="python=$PYTHON_VERSION pip pytest pytest-cov \
70-
numpy=$NUMPY_VERSION scipy=$SCIPY_VERSION \
71-
cython=$CYTHON_VERSION"
72-
73-
if [[ "$INSTALL_MKL" == "true" ]]; then
74-
TO_INSTALL="$TO_INSTALL mkl"
75-
else
76-
TO_INSTALL="$TO_INSTALL nomkl"
77-
fi
78-
79-
if [[ -n "$PANDAS_VERSION" ]]; then
80-
TO_INSTALL="$TO_INSTALL pandas=$PANDAS_VERSION"
81-
fi
82-
83-
if [[ -n "$PYAMG_VERSION" ]]; then
84-
TO_INSTALL="$TO_INSTALL pyamg=$PYAMG_VERSION"
85-
fi
86-
87-
if [[ -n "$PILLOW_VERSION" ]]; then
88-
TO_INSTALL="$TO_INSTALL pillow=$PILLOW_VERSION"
89-
fi
90-
91-
if [[ -n "$JOBLIB_VERSION" ]]; then
92-
TO_INSTALL="$TO_INSTALL joblib=$JOBLIB_VERSION"
93-
fi
94-
make_conda $TO_INSTALL
95-
96-
elif [[ "$DISTRIB" == "ubuntu" ]]; then
97-
# At the time of writing numpy 1.9.1 is included in the travis
98-
# virtualenv but we want to use the numpy installed through apt-get
99-
# install.
100-
deactivate
101-
# Create a new virtualenv using system site packages for python, numpy
102-
# and scipy
103-
virtualenv --system-site-packages --python=python3 testvenv
104-
source testvenv/bin/activate
105-
pip install pytest pytest-cov cython joblib==$JOBLIB_VERSION
106-
107-
elif [[ "$DISTRIB" == "scipy-dev" ]]; then
108-
make_conda python=3.7
109-
pip install --upgrade pip setuptools
110-
111-
echo "Installing numpy and scipy master wheels"
112-
dev_url=https://7933911d6844c6c53a7d-47bd50c35cd79bd838daf386af554a83.ssl.cf2.rackcdn.com
113-
pip install --pre --upgrade --timeout=60 -f $dev_url numpy scipy pandas cython
114-
echo "Installing joblib master"
115-
pip install https://github.com/joblib/joblib/archive/master.zip
116-
echo "Installing pillow master"
117-
pip install https://github.com/python-pillow/Pillow/archive/master.zip
118-
pip install pytest==4.6.4 pytest-cov
119-
fi
120-
121-
if [[ "$COVERAGE" == "true" ]]; then
122-
pip install coverage codecov
123-
fi
124-
125-
if [[ "$TEST_DOCSTRINGS" == "true" ]]; then
126-
pip install sphinx numpydoc # numpydoc requires sphinx
127-
fi
23+
export CC=/usr/lib/ccache/gcc
24+
export CXX=/usr/lib/ccache/g++
25+
# Useful for debugging how ccache is used
26+
# export CCACHE_LOGFILE=/tmp/ccache.log
27+
# ~60M is used by .ccache when compiling from scratch at the time of writing
28+
ccache --max-size 100M --show-stats
29+
30+
# Deactivate the travis-provided virtual environment and setup a
31+
# conda-based environment instead
32+
# If Travvis has language=generic, deactivate does not exist. `|| :` will pass.
33+
deactivate || :
34+
35+
# Install miniconda
36+
fname=Miniconda3-latest-Linux-x86_64.sh
37+
wget https://repo.continuum.io/miniconda/$fname -O miniconda.sh
38+
MINICONDA_PATH=$HOME/miniconda
39+
chmod +x miniconda.sh && ./miniconda.sh -b -p $MINICONDA_PATH
40+
export PATH=$MINICONDA_PATH/bin:$PATH
41+
conda update --yes conda
42+
43+
# Create environment and install dependencies
44+
conda create -n testenv --yes python=3.7
45+
source activate testenv
46+
47+
pip install --upgrade pip setuptools
48+
echo "Installing numpy and scipy master wheels"
49+
dev_url=https://7933911d6844c6c53a7d-47bd50c35cd79bd838daf386af554a83.ssl.cf2.rackcdn.com
50+
pip install --pre --upgrade --timeout=60 -f $dev_url numpy scipy pandas cython
51+
echo "Installing joblib master"
52+
pip install https://github.com/joblib/joblib/archive/master.zip
53+
echo "Installing pillow master"
54+
pip install https://github.com/python-pillow/Pillow/archive/master.zip
55+
pip install pytest==4.6.4 pytest-cov
12856

12957
# Build scikit-learn in the install.sh script to collapse the verbose
13058
# build output in the travis output when it succeeds.
13159
python --version
13260
python -c "import numpy; print('numpy %s' % numpy.__version__)"
13361
python -c "import scipy; print('scipy %s' % scipy.__version__)"
134-
python -c "\
135-
try:
136-
import pandas
137-
print('pandas %s' % pandas.__version__)
138-
except ImportError:
139-
pass
140-
"
62+
14163
python setup.py develop
142-
if [ $TRAVIS_OS_NAME = "linux" ]
143-
then
144-
ccache --show-stats
145-
fi
64+
65+
ccache --show-stats
14666
# Useful for debugging how ccache is used
14767
# cat $CCACHE_LOGFILE
14868

0 commit comments

Comments
 (0)