forked from mne-tools/mne-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
144 lines (135 loc) · 5.13 KB
/
.travis.yml
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
language: generic
dist: bionic
cache:
pip: true
addons:
apt:
packages:
- libxkbcommon-x11-0
- libxcb*
- libosmesa6
- libglx-mesa0
- libopengl0
- libglx0
- libdbus-1-3
env:
# OPENBLAS_NUM_THREADS=1 avoid slowdowns:
# https://github.com/xianyi/OpenBLAS/issues/731
global: PYTHON_VERSION=3.7 DISPLAY=:99.0 MNE_LOGGING_LEVEL=warning
CONDA_VERSION=">=4.3.27" OPENBLAS_NUM_THREADS=1 PYTHONUNBUFFERED=1
matrix:
include:
# Linux
- os: linux
env: CONDA_ENV="environment.yml"
# PIP + non-default stim channel + log level info
- os: linux
env: MNE_STIM_CHANNEL=STI101 MNE_LOGGING_LEVEL=info
language: python
python: "3.8"
# Old dependencies
- os: linux
env: PYTHON_VERSION=3.6
CONDA_DEPENDENCIES="numpy=1.13 scipy=1.0 matplotlib=2.1 pandas=0.21 scikit-learn=0.19"
CONDA_CHANNELS="conda-forge"
# Minimal (runs with and without testing data)
- os: linux
env: DEPS=minimial
CONDA_DEPENDENCIES="numpy scipy matplotlib"
MNE_DONTWRITE_HOME=true MNE_FORCE_SERIAL=true MNE_SKIP_NETWORK_TEST=1
# Setup anaconda
before_install:
- /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1400x900x24 -ac +extension GLX +render -noreset;
- |
if [ -z "$CONDA_ENV" ] && [ -z "$CONDA_DEPENDENCIES" ]; then
pip uninstall -yq numpy
pip install -i "https://pypi.anaconda.org/scipy-wheels-nightly/simple" --pre "numpy<1.20.0.dev0+20200811"
pip install -f "https://7933911d6844c6c53a7d-47bd50c35cd79bd838daf386af554a83.ssl.cf2.rackcdn.com" scipy pandas scikit-learn matplotlib h5py Pillow
pip install --upgrade -r requirements.txt
else
git clone https://github.com/astropy/ci-helpers.git
source ci-helpers/travis/setup_conda.sh
if [ ! -z "$CONDA_ENV" ]; then
conda env update --file $CONDA_ENV
conda activate mne
pip uninstall -yq mne
fi
fi
# Always install these via pip so we get the latest possible versions (testing bugfixes)
- pip install --upgrade -r requirements_testing.txt codecov
- if [ "${DEPS}" != "minimal" ]; then
pip install nitime;
fi
# Don't source mne_setup_sh here because changing PATH etc. can't be done in a script
- if [ "${DEPS}" != "minimal" ]; then
source tools/get_minimal_commands.sh;
mne_surf2bem --version;
fi;
install:
# Suppress the parallel outputs for logging cleanliness
- python setup.py build
- python setup.py install
- mne sys_info
- python -c "import numpy; numpy.show_config()"
- SRC_DIR=$(pwd)
- cd ~
# Trigger download of testing data
- if [ "${DEPS}" != "minimal" ]; then
python -c 'import mne; mne.datasets.testing.data_path(verbose=True)';
fi;
- cd ${SRC_DIR}
script:
- echo "Print locale "
- locale
- echo "Other stuff"
# OSX runs ~2x slower than Linux on Travis, so skip any slow ones there
# Until https://github.com/numpy/numpy/issues/15580 is resolved we also
# need the --pre wheels to skip slow ones.
- CONDITION='not ultraslowtest';
# Determine directories to test (could use SPLIT=0 SPLIT=1 but currently
# we are fast enough, so disable it)
- if [ -z ${SPLIT} ]; then
USE_DIRS="mne/";
else
if [ "${SPLIT}" == "0" ]; then
MNE_DIRS=". beamformer channels commands connectivity datasets decoding forward gui inverse_sparse io";
elif [ "${SPLIT}" == "1" ]; then
MNE_DIRS="minimum_norm preprocessing realtime simulation stats time_frequency viz";
elif [ "${SPLIT}" == "2" ]; then
MNE_DIRS=".";
else
MNE_DIRS="beamformer channels commands connectivity datasets decoding forward gui inverse_sparse io";
fi;
USE_DIRS="";
for DIR in ${MNE_DIRS}; do
if [ "${DIR}" == "." ]; then
USE_DIRS="mne/tests mne/*.py ${USE_DIRS}";
else
USE_DIRS="mne/${DIR}/ ${USE_DIRS}";
fi;
done;
fi;
# Remove numpydoc tests on older Python (builtin docstrings not as good)
- if [ "${PYTHON_VERSION}" == "3.6" ]; then
pip uninstall -yq numpydoc;
fi;
# Test run_tests_if_main
- if [ "${DEPS}" == "minimal" ]; then
pip uninstall -yq mne;
pip install -e .;
python mne/tests/test_evoked.py;
fi;
- echo 'pytest -m "${CONDITION}" --tb=short --cov=mne -vv ${USE_DIRS}'
- pytest -m "${CONDITION}" --tb=short --cov=mne -vv ${USE_DIRS}
# run the minimal one with the testing data
- if [ "${DEPS}" == "minimal" ]; then
export MNE_SKIP_TESTING_DATASET_TESTS=false;
python -c 'import mne; mne.datasets.testing.data_path(verbose=True)';
fi;
- if [ "${DEPS}" == "minimal" ]; then
pytest -m "${CONDITION}" --tb=short --cov=mne -vv ${USE_DIRS};
fi;
after_script:
# Need to run from source dir to exectue "git" commands
- cd ${SRC_DIR};
- codecov;