Skip to content

Commit 2847652

Browse files
committed
Merge remote-tracking branch 'upstream/main' into abcct_bug_fix
2 parents 863ff75 + f04fcaa commit 2847652

754 files changed

Lines changed: 26999 additions & 7274 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.circleci/config.yml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,6 @@ jobs:
9393
name: Set BASH_ENV
9494
command: ./tools/circleci_bash_env.sh
9595

96-
- run:
97-
name: check neuromag2ft
98-
command: |
99-
neuromag2ft --version
100-
10196
- run:
10297
name: Install fonts needed for diagrams
10398
command: |
@@ -218,6 +213,9 @@ jobs:
218213
- restore_cache:
219214
keys:
220215
- data-cache-phantom-kit
216+
- restore_cache:
217+
keys:
218+
- data-cache-ds004388
221219
- run:
222220
name: Get data
223221
# This limit could be increased, but this is helpful for finding slow ones
@@ -241,6 +239,7 @@ jobs:
241239
make test-doc;
242240
mkdir -p doc/_build/test-results/test-doc;
243241
cp junit-results.xml doc/_build/test-results/test-doc/junit.xml;
242+
cp coverage.xml doc/_build/test-results/test-doc/coverage.xml;
244243
fi;
245244
# Build docs
246245
- run:
@@ -252,7 +251,7 @@ jobs:
252251
name: Check sphinx log for warnings (which are treated as errors)
253252
when: always
254253
command: |
255-
! grep "^.* WARNING: .*$" sphinx_log.txt
254+
! grep "^.*\(WARNING\|ERROR\): " sphinx_log.txt
256255
- run:
257256
name: Show profiling output
258257
when: always
@@ -285,6 +284,15 @@ jobs:
285284
- store_artifacts:
286285
path: doc/_build/test-results
287286
destination: test-results
287+
# Upload test results to Codecov
288+
- run:
289+
name: Upload test results to Codecov
290+
environment:
291+
CODECOV_TOKEN: fb4c4a94-72d7-4743-bb08-af25b623a29a
292+
command: |
293+
if [[ -f doc/_build/test-results/test-doc/coverage.xml ]]; then
294+
bash <(curl -s https://codecov.io/bash) -f doc/_build/test-results/test-doc/coverage.xml || true
295+
fi
288296
# Save the SG RST
289297
- store_artifacts:
290298
path: doc/auto_examples.zip
@@ -393,6 +401,10 @@ jobs:
393401
key: data-cache-phantom-kit
394402
paths:
395403
- ~/mne_data/MNE-phantom-KIT-data # (1 G)
404+
- save_cache:
405+
key: data-cache-ds004388
406+
paths:
407+
- ~/mne_data/ds004388 # (1.8 G)
396408

397409

398410
linkcheck:

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,20 @@ Again, thanks for contributing!
1515
1616
-->
1717

18-
#### Reference issue
19-
Example: Fixes #1234.
18+
#### Reference issue (if any)
19+
20+
<!-- Example:
21+
22+
Fixes #1234.
23+
24+
-->
2025

2126

2227
#### What does this implement/fix?
23-
Explain your changes.
28+
29+
<!-- Explain your changes. -->
2430

2531

2632
#### Additional information
27-
Any additional information you think is important.
33+
34+
<!-- Any additional information you think is important. -->

.github/workflows/autofix.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- uses: actions/checkout@v4
16+
with:
17+
persist-credentials: false
1618
- uses: actions/setup-python@v5
1719
with:
1820
python-version: '3.12'
1921
- run: pip install --upgrade towncrier pygithub gitpython numpy
2022
- run: python ./.github/actions/rename_towncrier/rename_towncrier.py
2123
- run: python ./tools/dev/ensure_headers.py
22-
- uses: autofix-ci/action@dd55f44df8f7cdb7a6bf74c78677eb8acd40cd0a
24+
- uses: autofix-ci/action@635ffb0c9798bd160680f18fd73371e355b85f27

.github/workflows/automerge.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Bot auto-merge
2+
on: pull_request # yamllint disable-line rule:truthy
3+
4+
jobs:
5+
autobot:
6+
permissions:
7+
contents: write
8+
pull-requests: write
9+
runs-on: ubuntu-latest
10+
# Names can be found with gh api /repos/mne-tools/mne-python/pulls/12998 -q .user.login for example
11+
if: (github.event.pull_request.user.login == 'dependabot[bot]' || github.event.pull_request.user.login == 'pre-commit-ci[bot]' || github.event.pull_request.user.login == 'github-actions[bot]') && github.repository == 'mne-tools/mne-python'
12+
steps:
13+
- name: Enable auto-merge for bot PRs
14+
run: gh pr merge --auto --squash "$PR_URL"
15+
env:
16+
PR_URL: ${{github.event.pull_request.html_url}}
17+
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}

.github/workflows/check_changelog.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@ on: # yamllint disable-line rule:truthy
55
types: [opened, synchronize, labeled, unlabeled]
66
branches: ["main"]
77

8+
permissions:
9+
contents: read
10+
811
jobs:
912
changelog_checker:
10-
name: Check towncrier entry in doc/changes/devel/
13+
name: Check towncrier entry in doc/changes/dev/
1114
runs-on: ubuntu-latest
1215
steps:
1316
- uses: scientific-python/action-towncrier-changelog@v1

.github/workflows/circle_artifacts.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
on: [status] # yamllint disable-line rule:truthy
2+
permissions:
3+
contents: read
4+
statuses: write
25
jobs:
36
circleci_artifacts_redirector_job:
47
if: "${{ startsWith(github.event.context, 'ci/circleci: build_docs') }}"
5-
runs-on: ubuntu-20.04
8+
runs-on: ubuntu-latest
69
name: Run CircleCI artifacts redirector
710
steps:
811
- name: GitHub Action step

.github/workflows/codeql-analysis.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ jobs:
3939
steps:
4040
- name: Checkout repository
4141
uses: actions/checkout@v4
42+
with:
43+
persist-credentials: false
4244

4345
# Initializes the CodeQL tools for scanning.
4446
- name: Initialize CodeQL
@@ -48,11 +50,11 @@ jobs:
4850
# If you wish to specify custom queries, you can do so here or in a config file.
4951
# By default, queries listed here will override any specified in a config file.
5052
# Prefix the list here with "+" to use these queries and those in the config file.
51-
53+
5254
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
5355
# queries: security-extended,security-and-quality
5456

55-
57+
5658
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5759
# If this step fails, then you should remove it and run the build manually (see below)
5860
- name: Autobuild
@@ -61,7 +63,7 @@ jobs:
6163
# ℹ️ Command-line programs to run using the OS shell.
6264
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
6365

64-
# If the Autobuild fails above, remove it and uncomment the following three lines.
66+
# If the Autobuild fails above, remove it and uncomment the following three lines.
6567
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
6668

6769
# - run: |

.github/workflows/credit.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,20 @@ on: # yamllint disable-line rule:truthy
66
- cron: '0 0 1 * *' # At 00:00 on day-of-month 1
77
workflow_dispatch:
88

9-
permissions:
10-
contents: write
11-
pull-requests: write
12-
139
jobs:
1410
update_credit:
11+
permissions:
12+
contents: write
13+
pull-requests: write
1514
name: Update
1615
runs-on: ubuntu-latest
1716
env:
1817
GH_TOKEN: ${{ github.token }}
1918
GITHUB_TOKEN: ${{ github.token }}
2019
steps:
2120
- uses: actions/checkout@v4
21+
with:
22+
persist-credentials: true
2223
- uses: actions/setup-python@v5
2324
with:
2425
python-version: '3.12'
@@ -37,8 +38,8 @@ jobs:
3738
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
3839
git config --global user.name "github-actions[bot]"
3940
git checkout -b credit
40-
git commit -am "MAINT: Update code credit [ci skip]"
41+
git commit -am "MAINT: Update code credit"
4142
git push origin credit
42-
PR_NUM=$(gh pr create --base main --head credit --title "MAINT: Update code credit" --body "Created by \"${{ github.workflow }}\" GitHub action." --label "no-changelog-entry-needed")
43+
PR_NUM=$(gh pr create --base main --head credit --title "MAINT: Update code credit" --body "Created by credit [GitHub action](https://github.com/mne-tools/mne-python/actions/runs/${{ github.run_id }})." --label "no-changelog-entry-needed")
4344
echo "Opened https://github.com/mne-tools/mne-python/pull/${PR_NUM}" >> $GITHUB_STEP_SUMMARY
4445
if: steps.status.outputs.dirty == 'true'

.github/workflows/release.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ jobs:
1717
runs-on: ubuntu-latest
1818
steps:
1919
- uses: actions/checkout@v4
20+
with:
21+
persist-credentials: false
2022
- uses: actions/setup-python@v5
2123
with:
2224
python-version: '3.10'

.github/workflows/tests.yml

Lines changed: 59 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ on: # yamllint disable-line rule:truthy
77
branches: ["main", "maint/*"]
88
pull_request:
99
branches: ["main", "maint/*"]
10+
# adapted from spyder-ide/spyder
11+
workflow_dispatch:
12+
inputs:
13+
ssh:
14+
description: 'Enable ssh debugging'
15+
required: false
16+
default: false
17+
type: boolean
1018

1119
permissions:
1220
contents: read
@@ -18,9 +26,11 @@ jobs:
1826
timeout-minutes: 3
1927
steps:
2028
- uses: actions/checkout@v4
29+
with:
30+
persist-credentials: false
2131
- uses: actions/setup-python@v5
2232
with:
23-
python-version: '3.12'
33+
python-version: '3.13'
2434
- uses: pre-commit/action@v3.0.1
2535
- run: pip install mypy numpy scipy vulture
2636
- run: mypy
@@ -40,8 +50,7 @@ jobs:
4050
pytest:
4151
name: '${{ matrix.os }} / ${{ matrix.kind }} / ${{ matrix.python }}'
4252
needs: style
43-
timeout-minutes: 70
44-
continue-on-error: true
53+
timeout-minutes: 80
4554
runs-on: ${{ matrix.os }}
4655
defaults:
4756
run:
@@ -54,70 +63,90 @@ jobs:
5463
MNE_CI_KIND: '${{ matrix.kind }}'
5564
CI_OS_NAME: '${{ matrix.os }}'
5665
strategy:
66+
fail-fast: false
5767
matrix:
5868
include:
5969
- os: ubuntu-latest
60-
python: '3.12'
70+
python: '3.13'
71+
kind: pip
72+
- os: ubuntu-latest
73+
python: '3.13'
6174
kind: pip-pre
6275
- os: ubuntu-latest
63-
python: '3.12'
76+
python: '3.13'
6477
kind: conda
6578
- os: macos-latest # arm64 (Apple Silicon)
66-
python: '3.12'
79+
python: '3.13'
6780
kind: mamba
6881
- os: macos-13 # latest Intel release
69-
python: '3.12'
82+
python: '3.13'
7083
kind: mamba
7184
- os: windows-latest
7285
python: '3.10'
7386
kind: mamba
7487
- os: ubuntu-latest
7588
python: '3.10'
7689
kind: minimal
77-
- os: ubuntu-20.04
90+
- os: ubuntu-22.04
7891
python: '3.10'
7992
kind: old
8093
steps:
8194
- uses: actions/checkout@v4
8295
with:
8396
fetch-depth: 0
97+
persist-credentials: false
98+
- name: Get commit message
99+
run: echo "COMMIT_MESSAGE=$(git show -s --format=%s ${{ github.event.pull_request.head.sha || github.sha }})" | tee -a ${GITHUB_ENV}
100+
- name: Triage SSH
101+
run: |
102+
if [[ "${{ inputs.ssh }}" == "true" ]] || [[ "$COMMIT_MESSAGE" == *"[actions ssh]"* ]]; then
103+
echo "ENABLE_SSH=true" | tee -a $GITHUB_ENV
104+
else
105+
echo "ENABLE_SSH=false" | tee -a $GITHUB_ENV
106+
fi
107+
- name: Setup Remote SSH Connection
108+
if: env.ENABLE_SSH == 'true'
109+
uses: mxschmitt/action-tmate@v3
110+
timeout-minutes: 80
111+
with:
112+
detached: true
84113
- run: ./tools/github_actions_env_vars.sh
85114
# Xvfb/OpenGL
86-
- uses: pyvista/setup-headless-display-action@main
115+
- uses: pyvista/setup-headless-display-action@v4
87116
with:
88117
qt: true
89118
pyvista: false
119+
wm: false
90120
# Python (if pip)
91121
- uses: actions/setup-python@v5
92122
with:
93123
python-version: ${{ matrix.python }}
94124
if: startswith(matrix.kind, 'pip')
95125
# Python (if conda)
96-
- name: Remove numba and dipy
97-
run: | # TODO: Remove when numba 0.59 and dipy 1.8 land on conda-forge
98-
sed -i '/numba/d' environment.yml
99-
sed -i '/dipy/d' environment.yml
100-
sed -i 's/- mne$/- mne-base/' environment.yml
101-
if: matrix.os == 'ubuntu-latest' && startswith(matrix.kind, 'conda') && matrix.python == '3.12'
102-
- uses: mamba-org/setup-micromamba@v1
126+
- name: Fixes for conda
127+
run: |
128+
# For some reason on Linux we get crashes
129+
if [[ "$RUNNER_OS" == "Linux" ]]; then
130+
sed -i "/numba/d" environment.yml
131+
elif [[ "$RUNNER_OS" == "macOS" ]]; then
132+
sed -i "" "s/ - PySide6 .*/ - PySide6 <6.8/g" environment.yml
133+
fi
134+
if: matrix.kind == 'conda' || matrix.kind == 'mamba'
135+
- uses: mamba-org/setup-micromamba@v2
103136
with:
104137
environment-file: ${{ env.CONDA_ENV }}
105138
environment-name: mne
106139
create-args: >-
107140
python=${{ env.PYTHON_VERSION }}
108-
mamba
109141
if: ${{ !startswith(matrix.kind, 'pip') }}
110-
# Make sure we have the right Python
111-
- run: python -c "import platform; assert platform.machine() == 'arm64', platform.machine()"
112-
if: matrix.os == 'macos-14'
113-
- run: ./tools/github_actions_dependencies.sh
142+
- run: bash ./tools/github_actions_dependencies.sh
114143
# Minimal commands on Linux (macOS stalls)
115-
- run: ./tools/get_minimal_commands.sh
116-
if: ${{ startswith(matrix.os, 'ubuntu') }}
117-
- run: ./tools/github_actions_infos.sh
144+
- run: bash ./tools/get_minimal_commands.sh
145+
if: startswith(matrix.os, 'ubuntu') && matrix.kind != 'minimal' && matrix.kind != 'old'
146+
- run: bash ./tools/github_actions_infos.sh
118147
# Check Qt
119-
- run: ./tools/check_qt_import.sh $MNE_QT_BACKEND
120-
if: ${{ env.MNE_QT_BACKEND != '' }}
148+
- run: bash ./tools/check_qt_import.sh $MNE_QT_BACKEND
149+
if: env.MNE_QT_BACKEND != ''
121150
- name: Run tests with no testing data
122151
run: MNE_SKIP_TESTING_DATASET_TESTS=true pytest -m "not (ultraslowtest or pgtest)" --tb=short --cov=mne --cov-report xml -vv -rfE mne/
123152
if: matrix.kind == 'minimal'
@@ -126,9 +155,9 @@ jobs:
126155
with:
127156
key: ${{ env.TESTING_VERSION }}
128157
path: ~/mne_data
129-
- run: ./tools/github_actions_download.sh
130-
- run: ./tools/github_actions_test.sh
131-
- uses: codecov/codecov-action@v4
158+
- run: bash ./tools/github_actions_download.sh
159+
- run: bash ./tools/github_actions_test.sh # for some reason on macOS we need to run "bash X" in order for a failed test run to show up
160+
- uses: codecov/codecov-action@v5
132161
with:
133162
token: ${{ secrets.CODECOV_TOKEN }}
134-
if: success()
163+
if: success() || failure()

0 commit comments

Comments
 (0)