MAINT: Patch old MNE ver test (#177) #1060
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CIs | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.type }} | |
cancel-in-progress: true | |
on: | |
pull_request: | |
push: | |
branches: [main] | |
schedule: | |
- cron: "0 4 * * 1" # At 04:00 on Monday | |
jobs: | |
style: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install ruff | |
- name: Lint with ruff | |
run: ruff . | |
pytest: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu, windows, macos] | |
mne: [main, maint/1.4] | |
opengl: ['opengl'] | |
python: ['3.11'] | |
name: [matrix] | |
include: | |
- os: ubuntu | |
mne: main | |
opengl: 'opengl' | |
python: '3.8' | |
name: old 3.8 | |
- os: ubuntu | |
mne: main | |
opengl: '' | |
python: '3.9' | |
name: no opengl | |
- os: ubuntu | |
mne: maint/1.4 | |
opengl: '' | |
python: '3.9' | |
name: no opengl | |
- os: ubuntu | |
mne: maint/1.3 | |
opengl: 'opengl' | |
python: '3.9' | |
name: old | |
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@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
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} PyQt5 | |
- run: ./tools/get_testing_version.sh | |
name: 'Get testing version' | |
working-directory: ../mne-python | |
- uses: actions/cache@v3 | |
with: | |
key: ${{ env.TESTING_VERSION }} | |
path: ~/mne_data | |
name: 'Cache testing 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') | |
- name: Show system information | |
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 | |
name: Run pyqtgraph-specific tests | |
# These are slow on macOS, so skip them | |
- run: pytest mne_qt_browser/tests/test_speed.py | |
name: Run benchmarks | |
if: runner.os != 'macOS' | |
- uses: codecov/codecov-action@v1 | |
if: always() | |
name: 'Upload coverage to CodeCov' | |
qt: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu] | |
mne: [main] | |
opengl: [opengl] | |
qt: [PyQt5, PyQt6, PySide2, 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@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
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" | |
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} | |
- name: Patch MNE 1.4 test | |
if: ${{ matrix.mne == '1.4' }} | |
run: patch -d ../mne-python < .github/workflows/mne_1_4.patch | |
- shell: bash -e {0} | |
run: ./tools/get_testing_version.sh | |
name: 'Get testing version' | |
working-directory: ../mne-python | |
- uses: actions/cache@v3 | |
with: | |
key: ${{ env.TESTING_VERSION }} | |
path: ~/mne_data | |
name: 'Cache testing 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 | |
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 | |
name: Run benchmarks | |
if: runner.os != 'Linux' || (matrix.qt != 'PySide2' && matrix.qt != 'PyQt5') | |
- uses: codecov/codecov-action@v1 | |
if: always() | |
name: 'Upload coverage to CodeCov' |