Skip to content

Commit 0b54496

Browse files
tsbinnsautofix-ci[bot]pre-commit-ci[bot]larsoner
authored
Test for MNE-Tools actions (#13971)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Eric Larson <larson.eric.d@gmail.com>
1 parent d529cf0 commit 0b54496

22 files changed

Lines changed: 194 additions & 721 deletions

‎.circleci/config.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ jobs:
138138
name: Check Qt
139139
command: |
140140
set -x
141-
./tools/check_qt_import.sh ${MNE_QT_BACKEND}
141+
curl -fsSL https://raw.githubusercontent.com/mne-tools/mne-tools/main/tools/check_qt_import.sh | bash -s -- $MNE_QT_BACKEND
142142
# Load tiny cache so that ~/.mne does not need to be created below
143143
- restore_cache:
144144
keys:

‎.extended_metadata.yaml‎

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# This file contains additional metadata about MNE-Python, beyond what is contained in `pyproject.toml`.
2+
# This information is used by the actions in MNE-Tools to generate `CITATION.cff` and `codemeta.json`.
3+
package_name: MNE-Python
4+
date_created: '2010-12-26'
5+
date_published: '2014-08-04'
6+
application_category: Neuroscience
7+
code_doi: 10.5281/zenodo.592483
8+
compound_surnames:
9+
- García Alanis
10+
- van Vliet
11+
- De Santis
12+
- Dupré la Tour
13+
- de la Torre-Ortiz
14+
- Arias Sarah
15+
- de la Torre
16+
- Cespedes Tenorio
17+
- Le Mentec
18+
- de Jong
19+
- de Montalivet
20+
- van den Bosch
21+
- Van den Bossche
22+
- Van Der Donckt
23+
- van der Meer
24+
- van Harmelen
25+
- Visconti di Oleggio Castello
26+
- van Es
27+
- de Zuazo
28+
- Niso Galán
29+
- Montoya Martinez
30+
preferred_citation:
31+
title: MEG and EEG Data Analysis with MNE-Python
32+
journal: Frontiers in Neuroscience
33+
type: article
34+
year: 2013
35+
volume: 7
36+
issue: 267
37+
start: 1
38+
end: 13
39+
doi: 10.3389/fnins.2013.00267
40+
authors:
41+
- family-names: Gramfort
42+
given-names: Alexandre
43+
- family-names: Luessi
44+
given-names: Martin
45+
- family-names: Larson
46+
given-names: Eric
47+
- family-names: Engemann
48+
given-names: Denis A.
49+
- family-names: Strohmeier
50+
given-names: Daniel
51+
- family-names: Brodbeck
52+
given-names: Christian
53+
- family-names: Goj
54+
given-names: Roman
55+
- family-names: Jas
56+
given-names: Mainak
57+
- family-names: Brooks
58+
given-names: Teon
59+
- family-names: Parkkonen
60+
given-names: Lauri
61+
- family-names: Hämäläinen
62+
given-names: Matti S.

‎.github/workflows/autofix.yml‎

Lines changed: 75 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ permissions:
88
contents: read
99

1010
jobs:
11-
autofix:
11+
autofix-changelog-headers:
1212
name: Autofix and style
1313
runs-on: ubuntu-latest
1414
steps:
@@ -24,3 +24,77 @@ jobs:
2424
- uses: j178/prek-action@v3.0.0
2525
- uses: autofix-ci/action@c5b2d67aa2274e7b5a18224e8171550871fc7e4a
2626
if: success() || failure()
27+
changed-files:
28+
name: Check for dependency-relevant changes
29+
runs-on: ubuntu-latest
30+
permissions:
31+
pull-requests: read
32+
outputs:
33+
dependencies: ${{ steps.check.outputs.dependencies }}
34+
steps:
35+
- name: Check whether any dependency input or generated file changed
36+
id: check
37+
env:
38+
GH_TOKEN: ${{ github.token }}
39+
PR_NUMBER: ${{ github.event.pull_request.number }}
40+
REPO: ${{ github.repository }}
41+
run: |
42+
set -eo pipefail
43+
# Also match the generated files themselves, so hand-edits get reverted
44+
PATTERN='^(pyproject\.toml|README\.rst|environment\.yml|tools/pylock\.ci-old\.toml|\.github/workflows/autofix\.yml)$'
45+
# Collect first: `grep -q` exits early, and the resulting SIGPIPE would
46+
# trip `pipefail` precisely when a file does match
47+
FILES=$(gh api --paginate "repos/${REPO}/pulls/${PR_NUMBER}/files" --jq '.[].filename')
48+
if grep -qE "$PATTERN" <<< "$FILES"; then
49+
echo "dependencies=true" | tee -a "$GITHUB_OUTPUT"
50+
else
51+
echo "dependencies=false" | tee -a "$GITHUB_OUTPUT"
52+
fi
53+
autofix-dependencies:
54+
name: Autoupdate 'old' CI lockfile, README dependencies, and environment file
55+
runs-on: ubuntu-latest
56+
needs: changed-files
57+
if: needs.changed-files.outputs.dependencies == 'true'
58+
steps:
59+
- uses: actions/checkout@v7.0.1
60+
with:
61+
persist-credentials: false
62+
- uses: astral-sh/setup-uv@v9.0.0
63+
with:
64+
version: ">=0.9"
65+
activate-environment: true
66+
enable-cache: false
67+
python-version: "3.12"
68+
- name: Update 'old' CI lockfile
69+
# uv pip compile requires setting the python version for the environment explicitly in the command :(
70+
run: |
71+
uv pip compile pyproject.toml \
72+
--python "3.11" --python-platform "x86_64-unknown-linux-gnu" \
73+
--group test --group lockfile_extras \
74+
--resolution lowest-direct \
75+
--format pylock.toml --output-file tools/pylock.ci-old.toml \
76+
--no-cache
77+
- name: Validate 'old' CI lockfile
78+
uses: mne-tools/mne-tools/actions/check-lockfile@main
79+
with:
80+
project-root: ${{ github.workspace }}
81+
lockfile-path: tools/pylock.ci-old.toml
82+
groups: lockfile_extras
83+
- name: Sync dependencies to README
84+
uses: mne-tools/mne-tools/actions/sync-dependencies-to-readme@main
85+
with:
86+
project-root: ${{ github.workspace }}
87+
ignore-upper-pins: numpy
88+
- name: Sync dependencies to environment file
89+
uses: mne-tools/mne-tools/actions/sync-dependencies-to-environment-file@main
90+
with:
91+
project-root: ${{ github.workspace }}
92+
extras: full,full-no-qt,hdf5
93+
# manually specify extras groups to sync, as logic for recursion into other groups isn't implemented in the action yet (see mne-tools#40)
94+
# e.g., `full` includes `mne[full-no-qt]`, but the action won't recognise this, so we need to specify `full-no-qt` explicitly
95+
# ffmpeg is pinned to work around a conda solver issue (gh-14023)
96+
additional-dependencies: pip,mamba,conda,nomkl,noqt5,ffmpeg==8.1.2
97+
pip-dependencies: pymef
98+
requirements-overrides: PySide6==6.11.1,vtk==9.6.2
99+
- uses: autofix-ci/action@c5b2d67aa2274e7b5a18224e8171550871fc7e4a
100+
if: success() || failure()

‎.github/workflows/scheduled_updates.yml‎

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -65,19 +65,6 @@ jobs:
6565
- name: Update tracked dependencies
6666
if: matrix.id == 'spec_zero'
6767
run: python ./tools/dev/spec_zero_update_versions.py
68-
- name: Sync updated dependencies to README
69-
if: matrix.id == 'spec_zero'
70-
run: python tools/sync_dependencies.py
71-
- name: Create lockfile for old CI
72-
if: matrix.id == 'spec_zero'
73-
# uv pip compile requires setting the python version explicitly in the command :(
74-
run: |
75-
uv pip compile pyproject.toml \
76-
--python "3.11" --python-platform "x86_64-unknown-linux-gnu" \
77-
--group test --group lockfile_extras \
78-
--resolution lowest-direct \
79-
--format pylock.toml --output-file tools/pylock.ci-old.toml
80-
python tools/github_actions_check_old_lockfile.py
8168
- name: Update pre-commit hook versions
8269
if: matrix.id == 'prek_auto_update'
8370
run: prek auto-update

‎.github/workflows/tests.yml‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,11 @@ jobs:
130130
- run: bash ./tools/github_actions_verify_python.sh "${{ matrix.python }}"
131131
- run: bash ./tools/github_actions_dependencies.sh
132132
timeout-minutes: 10
133-
- run: python ./tools/github_actions_check_old_env.py
133+
- name: Check 'old' CI environment
134+
uses: mne-tools/mne-tools/actions/check-environment@main
135+
with:
136+
project-root: ${{ github.workspace }}
137+
groups: lockfile_extras
134138
if: matrix.kind == 'old'
135139
# Minimal commands on Linux (macOS stalls)
136140
- uses: actions/cache@v6.1.0
@@ -141,8 +145,10 @@ jobs:
141145
- run: bash ./tools/get_minimal_commands.sh
142146
if: startswith(matrix.os, 'ubuntu') && matrix.kind != 'minimal' && matrix.kind != 'old' && matrix.kind != 'pip-ft'
143147
- run: bash ./tools/github_actions_infos.sh
144-
# Check Qt
145-
- run: bash ./tools/check_qt_import.sh $MNE_QT_BACKEND
148+
- name: Check Qt import
149+
uses: mne-tools/mne-tools/actions/check-qt-import@main
150+
with:
151+
qt-backend: ${{ env.MNE_QT_BACKEND }}
146152
if: env.MNE_QT_BACKEND != ''
147153
- name: Run tests with no testing data
148154
run: MNE_SKIP_TESTING_DATASET_TESTS=true pytest -m "not (ultraslowtest or pgtest)" -n "$PYTEST_XDIST_N" --dist loadscope --timeout=120 --timeout-method=thread -o faulthandler_timeout=110 $COV_ARGS --tb=short -vv -rfE mne/

‎.pre-commit-config.yaml‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -96,15 +96,6 @@ repos:
9696
entry: ./tools/hooks/sort_contributor_names.py
9797
files: '^(doc/changes/names.inc|.mailmap)$'
9898

99-
# dependencies
100-
- repo: local
101-
hooks:
102-
- id: update-env-file
103-
name: Copy dependency changes from pyproject.toml to environment.yml
104-
language: python
105-
entry: ./tools/hooks/update_environment_file.py
106-
files: '^(pyproject.toml|tools/hooks/update_environment_file.py)$'
107-
10899
# zizmor
109100
- repo: https://github.com/woodruffw/zizmor-pre-commit
110101
rev: v1.29.0

‎.yamllint.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ rules:
88
document-start: disable
99
new-lines:
1010
type: platform
11+
indentation:
12+
indent-sequences: consistent

‎README.rst‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -70,20 +70,20 @@ Dependencies
7070

7171
The minimum required dependencies to run MNE-Python are:
7272

73-
.. ↓↓↓ BEGIN CORE DEPS LIST. DO NOT EDIT! HANDLED BY PRE-COMMIT HOOK ↓↓↓
73+
.. ↓↓↓ BEGIN CORE DEPS LIST. DO NOT EDIT! HANDLED BY MNE-TOOLS ↓↓↓
7474
7575
- `Python <https://www.python.org>`__ ≥ 3.11
76-
- `NumPy <https://numpy.org>`__ ≥ 2.0
77-
- `SciPy <https://scipy.org>`__ ≥ 1.14
76+
- `decorator <https://pypi.org/project/decorator/>`__ ≥ 5.1
77+
- `Jinja2 <https://jinja.palletsprojects.com/>`__ ≥ 3.1
78+
- `lazy-loader <https://pypi.org/project/lazy-loader/>`__ ≥ 0.3
7879
- `Matplotlib <https://matplotlib.org>`__ ≥ 3.9
79-
- `Pooch <https://www.fatiando.org/pooch/latest/>`__ ≥ 1.5
80+
- `NumPy <https://numpy.org>`__ ≥ 2.0
81+
- `packaging <https://packaging.pypa.io/>`__
82+
- `Pooch <https://www.fatiando.org/pooch>`__ ≥ 1.5
83+
- `SciPy <https://scipy.org/>`__ ≥ 1.14
8084
- `tqdm <https://tqdm.github.io>`__ ≥ 4.66
81-
- `Jinja2 <https://palletsprojects.com/p/jinja/>`__ ≥ 3.1
82-
- `decorator <https://github.com/micheles/decorator>`__ ≥ 5.1
83-
- `lazy-loader <https://pypi.org/project/lazy_loader>`__ ≥ 0.3
84-
- `packaging <https://packaging.pypa.io/en/stable/>`__
8585

86-
.. ↑↑↑ END CORE DEPS LIST. DO NOT EDIT! HANDLED BY PRE-COMMIT HOOK ↑↑↑
86+
.. ↑↑↑ END CORE DEPS LIST. DO NOT EDIT! HANDLED BY MNE-TOOLS ↑↑↑
8787
8888
Contributing
8989
^^^^^^^^^^^^

‎azure-pipelines.yml‎

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,17 @@ stages:
4242
pool:
4343
vmImage: 'ubuntu-latest'
4444
variables:
45+
MNE_TOOLS_DIR: '$(Pipeline.Workspace)/mne-tools'
4546
DISPLAY: ':99'
4647
PYTEST_XDIST_N: '2' # Microsoft-hosted agents have 2 cores
4748
MNE_TEST_ALLOW_SKIP: '^$' # nothing
4849
MNE_BROWSER_PRECOMPUTE: 'false'
4950
steps:
50-
- bash: ./tools/setup_xvfb.sh
51+
- bash: |
52+
set -xeo pipefail
53+
git clone --depth 1 https://github.com/mne-tools/mne-tools.git "$MNE_TOOLS_DIR"
54+
displayName: Clone mne-tools
55+
- bash: $(MNE_TOOLS_DIR)/tools/setup_xvfb.sh
5156
displayName: Setup up Xvfb
5257
- task: Cache@2
5358
inputs:
@@ -66,7 +71,7 @@ stages:
6671
python -m pip install --progress-bar off --upgrade pip
6772
python -m pip install --progress-bar off --upgrade --only-binary=":all:" -e . --group=test "mne-qt-browser @ https://github.com/mne-tools/mne-qt-browser/archive/refs/heads/main.zip" pyvista scikit-learn python-picard qtpy nibabel sphinx-gallery "PySide6!=6.8.0,!=6.8.0.1,!=6.8.1.1,!=6.9.1" pandas neo pymatreader antio defusedxml curryreader pymef openmeeg
6873
displayName: Install dependencies with pip
69-
- bash: ./tools/check_qt_import.sh PySide6
74+
- bash: $(MNE_TOOLS_DIR)/tools/check_qt_import.sh PySide6
7075
displayName: Check Qt import
7176
- bash: |
7277
set -xeo pipefail
@@ -95,12 +100,17 @@ stages:
95100
pool:
96101
vmImage: 'ubuntu-latest'
97102
variables:
103+
MNE_TOOLS_DIR: '$(Pipeline.Workspace)/mne-tools'
98104
DISPLAY: ':99'
99105
PYTEST_XDIST_N: '2' # Microsoft-hosted agents have 2 cores
100106
TEST_OPTIONS: "--tb=short --cov=mne --cov-report=xml --cov-append -vv mne/gui mne/viz/_brain mne/viz/backends mne/viz/tests/test_evoked.py mne/report"
101107
MNE_TEST_ALLOW_SKIP: '^$' # nothing (can be overridden below)
102108
steps:
103-
- bash: ./tools/setup_xvfb.sh
109+
- bash: |
110+
set -xeo pipefail
111+
git clone --depth 1 https://github.com/mne-tools/mne-tools.git "$MNE_TOOLS_DIR"
112+
displayName: Clone mne-tools
113+
- bash: $(MNE_TOOLS_DIR)/tools/setup_xvfb.sh
104114
displayName: Setup up Xvfb
105115
- task: UsePythonVersion@0
106116
inputs:
@@ -128,7 +138,7 @@ stages:
128138
displayName: Cache testing data
129139
- bash: ./tools/github_actions_download.sh
130140
displayName: Download testing data
131-
- bash: ./tools/check_qt_import.sh PySide6
141+
- bash: $(MNE_TOOLS_DIR)/tools/check_qt_import.sh PySide6
132142
displayName: Check Qt import
133143
- bash: |
134144
set -xeo pipefail

‎environment.yml‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# THIS FILE IS AUTO-GENERATED BY tools/hooks/update_environment_file.py AND WILL BE OVERWRITTEN
1+
# THIS FILE IS AUTO-GENERATED BY MNE-TOOLS AND WILL BE OVERWRITTEN
22
name: mne
33
channels:
44
- conda-forge
@@ -13,15 +13,15 @@ dependencies:
1313
- dipy >=1.9
1414
- edfio >=0.4.10
1515
- eeglabio
16-
- ffmpeg =8.1.2
16+
- ffmpeg ==8.1.2
1717
- filelock >=3.18.0
1818
- h5io >=0.2.4
1919
- h5py >=2.4
2020
- imageio >=2.6.1
2121
- imageio-ffmpeg >=0.4.1
2222
- ipyevents
2323
- ipympl
24-
- ipython >=2.0,!=8.7.0
24+
- ipython !=8.7.0,>=2.0
2525
- ipywidgets
2626
- jinja2 >=3.1
2727
- joblib >=0.8
@@ -37,10 +37,10 @@ dependencies:
3737
- nomkl
3838
- noqt5
3939
- numba >=0.60
40-
- numpy >=2.0,<3
40+
- numpy <3,>=2.0
4141
- openmeeg >=2.5.7
4242
- packaging
43-
- pandas >=2.2,!=3.0.4
43+
- pandas !=3.0.4,>=2.2
4444
- pillow
4545
- pip
4646
- pooch >=1.5
@@ -70,4 +70,4 @@ dependencies:
7070
- xlrd
7171
- pip:
7272
- pymef
73-
- pyobjc-framework-Cocoa >=5.2.0;platform_system=='Darwin'
73+
- pyobjc-framework-Cocoa>=5.2.0; platform_system == "Darwin"

0 commit comments

Comments
 (0)