-
Notifications
You must be signed in to change notification settings - Fork 23
196 lines (195 loc) · 7.21 KB
/
qt_viz_tests.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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
name: CIs
concurrency:
group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.type }}
cancel-in-progress: true
on: # yamllint disable-line rule:truthy
pull_request:
push:
branches: [main]
schedule:
- cron: "0 4 * * 1" # At 04:00 on Monday
jobs:
pytest:
strategy:
fail-fast: false
matrix:
os: [ubuntu, windows, macos]
mne: [main, maint/1.7]
opengl: ['opengl']
python: ['3.12']
name: [matrix]
pip: ['']
include:
- os: ubuntu
mne: main
opengl: ''
python: '3.12'
name: no opengl
- os: ubuntu
mne: maint/1.7
opengl: ''
python: '3.12'
name: no opengl
- os: ubuntu
mne: maint/1.5
opengl: 'opengl'
python: '3.10'
name: old
- os: ubuntu
mne: main
opengl: 'opengl'
python: '3.12'
pip: pre
name: pip-pre
name: pytest ${{ matrix.name }} / ${{ matrix.os }} / MNE ${{ matrix.mne }}
runs-on: ${{ matrix.os }}-latest
env:
MNE_LOGGING_LEVEL: 'warning'
MKL_NUM_THREADS: '1'
PYTHONUNBUFFERED: '1'
MNE_BRANCH: ${{ matrix.mne }}
PYTHON_VERSION: ${{ matrix.python }}
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install dependencies
run: | # use MNE main to ensure test files are available
set -eo pipefail
python -m pip install --upgrade pip
git clone -b ${MNE_BRANCH} --single-branch --branch main https://github.com/mne-tools/mne-python.git ../mne-python
python -m pip install -qe ../mne-python
if [[ "${{ matrix.opengl }}" == "opengl" ]]; then
PIP_OPTION="[opengl,tests]"
else
PIP_OPTION="[tests]"
fi
python -m pip install -ve .${PIP_OPTION} "PyQt6!=6.6.1" "PyQt6-Qt6!=6.6.1,!=6.6.2,!=6.6.3"
if [[ "${{ matrix.pip }}" == "pre" ]]; then
echo "Upgrading to pre-release NumPy, SciPy, matplotlib, and pyqtgraph"
python -m pip install --upgrade --pre --only-binary ":all:" --default-timeout=60 --extra-index-url "https://pypi.anaconda.org/scientific-python-nightly-wheels/simple" "numpy>=2.0.0.dev0" "scipy>=1.14.0.dev0" "matplotlib>=3.9.0.dev0" "scikit-learn>=1.5.dev0" "git+https://github.com/pyqtgraph/pyqtgraph.git"
fi
- run: ./tools/get_testing_version.sh
working-directory: ../mne-python
- uses: actions/cache@v4
with:
key: ${{ env.TESTING_VERSION }}
path: ~/mne_data
- run: python -c 'import mne; print(mne.datasets.testing.data_path(verbose=True))'
name: 'Download testing data'
- uses: pyvista/setup-headless-display-action@main
with:
qt: true
- run: glxinfo | grep enderer
name: Check OpenGL
working-directory: ../mne-python
if: runner.os == 'Linux' && contains(matrix.opengl, 'opengl')
- run: mne sys_info
- run: pytest -m pgtest --cov=mne_qt_browser --cov-report=xml ../mne-python/mne/report ../mne-python/mne/viz
name: Run MNE-Tests
- run: pytest --error-for-skips mne_qt_browser/tests/test_pg_specific.py --cov-report=xml --cov-append
name: Run pyqtgraph-specific tests
# These are slow on macOS, so skip them
- run: pytest mne_qt_browser/tests/test_speed.py --cov-report=xml --cov-append
name: Run benchmarks
if: runner.os != 'macOS'
- uses: codecov/codecov-action@v4
if: always()
with:
token: ${{ secrets.CODECOV_TOKEN }}
qt:
strategy:
fail-fast: false
matrix:
os: [ubuntu]
mne: [main]
opengl: [opengl]
qt: [PyQt5, PyQt6, PySide6]
python: ['3.10'] # When going to 3.11, PySide2 should be removed or special-cased
name: [matrix]
include:
- os: macos
mne: main
opengl: 'opengl'
qt: PySide6
python: '3.11'
- os: windows
mne: main
opengl: 'opengl'
qt: PySide6
python: '3.11'
name: ${{ matrix.qt }} / ${{ matrix.os }}
runs-on: ${{ matrix.os }}-latest
env:
MNE_LOGGING_LEVEL: 'warning'
MKL_NUM_THREADS: '1'
PYTHONUNBUFFERED: '1'
MNE_BRANCH: ${{ matrix.mne }}
PYTHON_VERSION: ${{ matrix.python }}
QT_LIB: ${{ matrix.qt }}
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install dependencies
run: | # use MNE main to ensure test files are available
set -eo pipefail
python -m pip install --upgrade pip
git clone -b ${MNE_BRANCH} --single-branch --branch main https://github.com/mne-tools/mne-python.git ../mne-python
python -m pip install -qe ../mne-python
# Avoid a problematic version of PySide6
# https://wiki.qt.io/Qt_for_Python_Development_Notes#1._Juni_2023
if [[ "$QT_LIB" == "PySide6" ]]; then
QT_LIB_INSTALL="PySide6!=6.5.1,!=6.7.0,!=6.7.1,!=6.8.0,!=6.8.0.1"
else
QT_LIB_INSTALL="$QT_LIB"
fi
if [[ "${{ matrix.opengl }}" == "opengl" ]]; then
PIP_OPTION="[opengl,tests]"
else
PIP_OPTION="[tests]"
fi
python -m pip install -ve .${PIP_OPTION} ${QT_LIB_INSTALL}
- run: bash ./tools/get_testing_version.sh
working-directory: ../mne-python
- uses: actions/cache@v4
with:
key: ${{ env.TESTING_VERSION }}
path: ~/mne_data
- run: python -c 'import mne; print(mne.datasets.testing.data_path(verbose=True))'
name: 'Download testing data'
- uses: pyvista/setup-headless-display-action@main
with:
qt: true
- name: Start Qt on its own
run: LD_DEBUG=libs python -c "from ${QT_LIB}.QtWidgets import QApplication, QWidget; app = QApplication([]); import matplotlib; matplotlib.use('QtAgg'); import matplotlib.pyplot as plt; plt.figure()"
- name: Check Qt
run: |
mne sys_info -pd
echo ${QT_LIB}:
mne sys_info -pd | grep "^.*qtpy.*${QT_LIB}=.*$"
- run: pytest -m pgtest --cov=mne_qt_browser --cov-report=xml ../mne-python/mne/report ../mne-python/mne/viz
name: Run MNE-Tests
- run: pytest --error-for-skips mne_qt_browser/tests/test_pg_specific.py --cov-report=xml --cov-append
name: Run pyqtgraph-specific tests
# For some reason this dies on Linux PySide2. We can live without this
# case given our primary target moving forward is Qt6+
- run: pytest mne_qt_browser/tests/test_speed.py --cov-report=xml --cov-append
name: Run benchmarks
if: runner.os != 'Linux' || matrix.qt != 'PyQt5'
- uses: codecov/codecov-action@v4
if: always()
with:
token: ${{ secrets.CODECOV_TOKEN }}