-
Notifications
You must be signed in to change notification settings - Fork 409
/
install.sh
executable file
·82 lines (70 loc) · 2.68 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/bin/bash
# This script is meant to be called by the "install" step defined in
# .travis.yml. See http://docs.travis-ci.com/ for more details.
# The behavior of the script is controlled by environment variabled defined
# in the .travis.yml in the top level folder of the project.
#
# This script is adapted from a similar script from the scikit-learn repository.
#
# License: 3-clause BSD
set -e
create_new_conda_env() {
conda update --yes conda
# TODO: unpin pytest once it no longer causes test errors because of
# PytestRemovedIn8Warning warnings
TO_INSTALL="python=$PYTHON_VERSION pip pytest<7.0 $EXTRA_CONDA_PACKAGES"
conda create -n testenv --yes $TO_INSTALL
source activate testenv
}
create_new_pypy3_env() {
PYPY_FOLDER="pypy3.7-v7.3.7-linux64"
wget https://downloads.python.org/pypy/$PYPY_FOLDER.tar.bz2
tar xvf $PYPY_FOLDER.tar.bz2
$PYPY_FOLDER/bin/pypy3 -m venv pypy3
source pypy3/bin/activate
# TODO: unpin pytest once it no longer causes test errors because of
# PytestRemovedIn8Warning warnings
pip install -U pip pytest<7.0
}
if [[ "$PYTHON_VERSION" == "pypy3" ]]; then
create_new_pypy3_env
else
create_new_conda_env
fi
# Install py.test timeout to fasten failure in deadlocking tests
PIP_INSTALL_PACKAGES="pytest-timeout"
if [ -n "$NUMPY_VERSION" ]; then
# We want to ensure no memory copies are performed only when numpy is
# installed. This also ensures that we don't keep a strong dependency on
# memory_profiler. We also want to ensure that joblib can be used with and
# without lz4 compressor package installed.
PIP_INSTALL_PACKAGES="$PIP_INSTALL_PACKAGES memory_profiler"
if [ "$NO_LZ4" != "true" ]; then
PIP_INSTALL_PACKAGES="$PIP_INSTALL_PACKAGES lz4"
fi
fi
if [[ "$COVERAGE" == "true" ]]; then
# TODO: unpin when https://github.com/nedbat/coveragepy/issues/883 is fixed
# Weird issues with recent version of coverage: unpin when not causing
# pytest to raise INTERNALERROR exceptions.
PIP_INSTALL_PACKAGES="$PIP_INSTALL_PACKAGES coverage==4.5.4 pytest-cov codecov"
fi
if [[ "pypy3" != *"$PYTHON_VERSION"* ]]; then
# threadpoolctl is only available for python 3.5+.
PIP_INSTALL_PACKAGES="$PIP_INSTALL_PACKAGES threadpoolctl"
fi
pip install $PIP_INSTALL_PACKAGES
if [[ "$NO_LZMA" == "1" ]]; then
# Delete the LZMA module from the standard lib to make sure joblib has no
# hard dependency on it:
LZMA_PATH=`python -c "import lzma; print(lzma.__file__)"`
echo "Deleting $LZMA_PATH..."
rm $LZMA_PATH
fi
if [[ "$CYTHON" == "true" ]]; then
pip install cython
cd joblib/test/_openmp_test_helper
python setup.py build_ext -i
cd ../../..
fi
pip install -v .