Skip to content

[MAINT] Fix failing unit tests & update CI packages #705

[MAINT] Fix failing unit tests & update CI packages

[MAINT] Fix failing unit tests & update CI packages #705

Workflow file for this run

name: 'unit_tests'
concurrency:
group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.type }}
cancel-in-progress: true
on:
push:
branches:
- 'main'
pull_request:
branches:
- '*'
jobs:
# Run style tests
style:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
python-version: [ 3.9 ]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install pip
run: |
pip install --upgrade pip setuptools wheel
pip install --upgrade --upgrade-strategy eager -r requirements.txt
pip install --upgrade --upgrade-strategy eager -r requirements_testing.txt
- name: Run style & documentation tests
run: make pep
# Run installation tests
install:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
python-version: [ "3.11" ]
include:
# An old one
- os: ubuntu-latest
python-version: "3.8"
steps:
- uses: actions/checkout@v4
- uses: pyvista/setup-headless-display-action@main
with:
qt: true
pyvista: false
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install --upgrade pip setuptools wheel
pip install --upgrade --upgrade-strategy eager -r requirements.txt
pip install --upgrade --upgrade-strategy eager -r requirements_testing.txt
- run: mne sys_info
- name: Build sdist
run: python setup.py sdist
- name: Install sdist
run: pip install ./dist/mne-connectivity-*
shell: bash -e {0}
- name: Clean up working directory
run: rm -rf ./*
shell: bash -e {0}
- name: Try importing mne_connectivity
run: python -c 'import mne_connectivity; print(mne_connectivity.__version__)'
- name: Remove sdist install
run: pip uninstall -y mne-connectivity
# build with build wheet
- uses: actions/checkout@v4
- name: Build wheel
run: python setup.py bdist_wheel
- name: Install wheel
run: pip install ./dist/mne_connectivity-*.whl
shell: bash -e {0}
- name: Clean up working directory
run: rm -rf ./*
shell: bash -e {0}
- name: Try importing mne_connectivity
run: python -c 'import mne_connectivity; print(mne_connectivity.__version__)'
- name: Remove wheel install
run: pip uninstall -y mne-connectivity
- uses: actions/checkout@v4
- name: Test extras install
run: |
pip install .[full]
python -c 'import mne_connectivity; print(mne_connectivity.__version__)'
# Run unit tests
test:
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -e {0}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
python-version: "3.8"
mne-version: mne-main
- os: ubuntu-latest
python-version: "3.11"
mne-version: mne-main
- os: macos-latest
python-version: "3.11"
mne-version: mne-main
- os: windows-latest
python-version: "3.11"
mne-version: mne-main
env:
TZ: Europe/Berlin
FORCE_COLOR: true
DISPLAY: ':99.0'
MNE_LOGGING_LEVEL: 'info'
OPENBLAS_NUM_THREADS: '1'
PYTHONUNBUFFERED: '1'
steps:
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: actions/checkout@v4
- uses: pyvista/setup-headless-display-action@main
with:
qt: true
pyvista: false
- name: Install dependencies
run: |
pip install --upgrade pip setuptools wheel
pip install --upgrade --upgrade-strategy eager -r requirements.txt -r requirements_testing.txt
- if: matrix.mne-version == 'mne-stable'
run: pip install --upgrade mne
- name: Install MNE (main)
if: matrix.mne-version == 'mne-main'
run: pip install git+https://github.com/mne-tools/mne-python@main
- run: python -c "import mne; print(mne.datasets.testing.data_path(verbose=True))"
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
- name: Display versions and environment information
run: |
echo $TZ
date
python --version
which python
- run: pip install -e .
- run: mne sys_info
- run: python -m pytest . --cov=mne_connectivity --cov-report=xml --cov-config=setup.cfg --verbose --ignore mne-python
- uses: codecov/codecov-action@v3