Skip to content

Commit 40794c7

Browse files
[pre-commit.ci] pre-commit autoupdate (#246)
* [pre-commit.ci] pre-commit autoupdate updates: - [github.com/astral-sh/ruff-pre-commit: v0.11.13 → v0.12.0](astral-sh/ruff-pre-commit@v0.11.13...v0.12.0) * bump to 3.10 * run fixes * fix more * fix workflows * add python 3.14 * remove 3.14 --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Mathieu Scheltienne <mathieu.scheltienne@dandelion.science>
1 parent a0eb0dc commit 40794c7

File tree

27 files changed

+82
-153
lines changed

27 files changed

+82
-153
lines changed

.github/workflows/doc.yaml

Lines changed: 11 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -12,39 +12,28 @@ jobs:
1212
build:
1313
timeout-minutes: 30
1414
runs-on: ubuntu-latest
15-
defaults:
16-
run:
17-
shell: bash
1815
steps:
19-
- name: Checkout repository
20-
uses: actions/checkout@v4
16+
- uses: actions/checkout@v4
2117
with:
2218
path: ./main
23-
- name: Setup Python 3.9
24-
uses: actions/setup-python@v5
19+
- uses: actions/setup-python@v5
2520
with:
26-
python-version: 3.9
27-
architecture: 'x64'
21+
python-version: 3.13
2822
- name: Install linux dependencies
2923
run: |
3024
sudo apt update
3125
sudo apt install optipng
32-
- name: Setup headless display
33-
uses: pyvista/setup-headless-display-action@main
26+
- uses: pyvista/setup-headless-display-action@main
3427
with:
3528
qt: true
3629
- name: Install package
3730
run: |
3831
python -m pip install --progress-bar off --upgrade pip setuptools
3932
python -m pip install --progress-bar off main/.[doc]
40-
- name: Display system information
41-
run: mne_icalabel-sys_info --developer
42-
- name: Build doc
43-
run: sphinx-build ./main/doc ./doc-build/dev -W --keep-going
44-
- name: Prune sphinx environment
45-
run: sudo rm -R ./doc-build/dev/.doctrees
46-
- name: Upload documentation
47-
uses: actions/upload-artifact@v4
33+
- run: mne_icalabel-sys_info --developer
34+
- run: sphinx-build ./main/doc ./doc-build/dev -W --keep-going
35+
- run: sudo rm -R ./doc-build/dev/.doctrees
36+
- uses: actions/upload-artifact@v4
4837
with:
4938
name: doc-dev
5039
path: ./doc-build/dev
@@ -56,19 +45,13 @@ jobs:
5645
runs-on: ubuntu-latest
5746
permissions:
5847
contents: write
59-
defaults:
60-
run:
61-
shell: bash
6248
steps:
63-
- name: Checkout repository
64-
uses: actions/checkout@v4
65-
- name: Download documentation
66-
uses: actions/download-artifact@v4
49+
- uses: actions/checkout@v4
50+
- uses: actions/download-artifact@v4
6751
with:
6852
name: doc-dev
6953
path: ./doc-dev
70-
- name: Deploy
71-
uses: JamesIves/github-pages-deploy-action@v4
54+
- uses: JamesIves/github-pages-deploy-action@v4
7255
with:
7356
folder: ./doc-dev
7457
target-folder: ./dev

.github/workflows/draft-pdf.yml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,12 @@ jobs:
99
runs-on: ubuntu-latest
1010
name: Paper Draft
1111
steps:
12-
- name: Checkout
13-
uses: actions/checkout@v4
14-
- name: Build draft PDF
15-
uses: openjournals/openjournals-draft-action@master
12+
- uses: actions/checkout@v4
13+
- uses: openjournals/openjournals-draft-action@master
1614
with:
1715
journal: joss
18-
# This should be the path to the paper within your repo.
1916
paper-path: paper/paper.md
20-
- name: Upload
21-
uses: actions/upload-artifact@v4
17+
- uses: actions/upload-artifact@v4
2218
with:
2319
name: paper
24-
# This is the output path where Pandoc will write the compiled
25-
# PDF. Note, this should be the same directory as the input
26-
# paper.md
2720
path: paper/paper.pdf

.github/workflows/publish.yaml

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,19 @@ jobs:
99
timeout-minutes: 10
1010
runs-on: ubuntu-latest
1111
steps:
12-
- name: Checkout repository
13-
uses: actions/checkout@v4
14-
- name: Setup Python 3.9
15-
uses: actions/setup-python@v5
12+
- uses: actions/checkout@v4
13+
- uses: actions/setup-python@v5
1614
with:
17-
python-version: '3.9'
18-
architecture: 'x64'
19-
- name: Setup headless display
20-
uses: pyvista/setup-headless-display-action@main
15+
python-version: '3.13'
16+
- uses: pyvista/setup-headless-display-action@main
2117
with:
2218
qt: true
2319
- name: Install dependencies
2420
run: |
2521
python -m pip install --progress-bar off --upgrade pip setuptools
2622
python -m pip install --progress-bar off -e .[build,stubs]
27-
- name: Display system information
28-
run: mne_icalabel-sys_info --developer
29-
- name: Generate stub files
30-
run: python tools/stubgen.py
23+
- run: mne_icalabel-sys_info --developer
24+
- run: python tools/stubgen.py
3125
- name: Build and publish
3226
env:
3327
TWINE_USERNAME: __token__

.github/workflows/pytest.yaml

Lines changed: 13 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -17,33 +17,27 @@ jobs:
1717
fail-fast: false
1818
matrix:
1919
os: [ubuntu, macos, windows]
20-
python-version: [3.9, "3.10", "3.11", "3.12"]
20+
python-version: ["3.10", "3.11", "3.12", "3.13"]
2121
name: ${{ matrix.os }} - py${{ matrix.python-version }}
2222
runs-on: ${{ matrix.os }}-latest
2323
defaults:
2424
run:
2525
shell: bash
2626
steps:
27-
- name: Checkout repository
28-
uses: actions/checkout@v4
29-
- name: Setup Python ${{ matrix.python-version }}
30-
uses: actions/setup-python@v5
27+
- uses: actions/checkout@v4
28+
- uses: actions/setup-python@v5
3129
with:
3230
python-version: ${{ matrix.python-version }}
33-
- name: Setup headless display
34-
uses: pyvista/setup-headless-display-action@main
31+
- uses: pyvista/setup-headless-display-action@main
3532
with:
3633
qt: true
3734
- name: Install package
3835
run: |
3936
python -m pip install --progress-bar off --upgrade pip setuptools
4037
python -m pip install --progress-bar off .[test]
41-
- name: Display system information
42-
run: mne_icalabel-sys_info --developer
43-
- name: Run pytest
44-
run: pytest mne_icalabel --cov=mne_icalabel --cov-report=xml --cov-config=pyproject.toml
45-
- name: Upload to codecov
46-
uses: codecov/codecov-action@v5
38+
- run: mne_icalabel-sys_info --developer
39+
- run: pytest mne_icalabel --cov=mne_icalabel --cov-report=xml --cov-config=pyproject.toml
40+
- uses: codecov/codecov-action@v5
4741
with:
4842
files: ./coverage.xml
4943
flags: unittests # optional
@@ -59,18 +53,12 @@ jobs:
5953
python-version: ["3.11"]
6054
name: pip pre-release - py${{ matrix.python-version }}
6155
runs-on: ubuntu-latest
62-
defaults:
63-
run:
64-
shell: bash
6556
steps:
66-
- name: Checkout repository
67-
uses: actions/checkout@v4
68-
- name: Setup Python ${{ matrix.python-version }}
69-
uses: actions/setup-python@v5
57+
- uses: actions/checkout@v4
58+
- uses: actions/setup-python@v5
7059
with:
7160
python-version: ${{ matrix.python-version }}
72-
- name: Setup headless display
73-
uses: pyvista/setup-headless-display-action@main
61+
- uses: pyvista/setup-headless-display-action@main
7462
with:
7563
qt: true
7664
- name: Install dependencies
@@ -80,12 +68,9 @@ jobs:
8068
python -m pip install --progress-bar off --upgrade git+https://github.com/mne-tools/mne-python
8169
python -m pip install --progress-bar off --upgrade git+https://github.com/mne-tools/mne-bids
8270
python -m pip install --progress-bar off --upgrade --pre --only-binary :all: -i https://pypi.anaconda.org/scientific-python-nightly-wheels/simple --timeout=180 numpy scipy matplotlib
83-
- name: Display system information
84-
run: mne_icalabel-sys_info --developer
85-
- name: Run pytest
86-
run: pytest mne_icalabel --cov=mne_icalabel --cov-report=xml --cov-config=pyproject.toml
87-
- name: Upload to codecov
88-
uses: codecov/codecov-action@v5
71+
- run: mne_icalabel-sys_info --developer
72+
- run: pytest mne_icalabel --cov=mne_icalabel --cov-report=xml --cov-config=pyproject.toml
73+
- uses: codecov/codecov-action@v5
8974
with:
9075
files: ./coverage.xml
9176
flags: unittests # optional

.github/workflows/stubs.yaml

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,29 +12,20 @@ jobs:
1212
generate:
1313
timeout-minutes: 10
1414
runs-on: ubuntu-latest
15-
defaults:
16-
run:
17-
shell: bash
1815
steps:
19-
- name: Checkout repository
20-
uses: actions/checkout@v4
21-
- name: Setup Python 3.9
22-
uses: actions/setup-python@v5
16+
- uses: actions/checkout@v4
17+
- uses: actions/setup-python@v5
2318
with:
24-
python-version: 3.9
25-
architecture: 'x64'
26-
- name: Setup headless display
27-
uses: pyvista/setup-headless-display-action@main
19+
python-version: 3.13
20+
- uses: pyvista/setup-headless-display-action@main
2821
with:
2922
qt: true
3023
- name: Install package
3124
run: |
3225
python -m pip install --progress-bar off --upgrade pip setuptools
3326
python -m pip install --progress-bar off -e .[stubs]
34-
- name: Display system information
35-
run: mne_icalabel-sys_info --developer
36-
- name: Generate stub files
37-
run: python tools/stubgen.py
27+
- run: mne_icalabel-sys_info --developer
28+
- run: python tools/stubgen.py
3829
- name: Push stub files
3930
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
4031
env:

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
3-
rev: v0.11.13
3+
rev: v0.12.0
44
hooks:
55
- id: ruff
66
name: ruff linter

doc/conf.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import sys
1010
from datetime import date
1111
from importlib import import_module
12-
from typing import Optional
1312

1413
import mne
1514
from sphinx_gallery.sorting import FileNameSortKey
@@ -260,7 +259,7 @@
260259
# https://www.sphinx-doc.org/en/master/usage/extensions/linkcode.html
261260

262261

263-
def linkcode_resolve(domain: str, info: dict[str, str]) -> Optional[str]:
262+
def linkcode_resolve(domain: str, info: dict[str, str]) -> str | None:
264263
"""Determine the URL corresponding to a Python object.
265264
266265
Parameters

mne_icalabel/annotation/bids.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,11 @@
1010

1111
if TYPE_CHECKING:
1212
from pathlib import Path
13-
from typing import Union
1413

1514
from mne.preprocessing import ICA
1615

1716

18-
def write_components_tsv(ica: ICA, fname: Union[str, Path]):
17+
def write_components_tsv(ica: ICA, fname: str | Path):
1918
"""Write channels tsv file for ICA components.
2019
2120
Will create an accompanying JSON sidecar to explain the
@@ -102,7 +101,7 @@ def write_components_tsv(ica: ICA, fname: Union[str, Path]):
102101

103102
def mark_component(
104103
component: int,
105-
fname: Union[str, Path],
104+
fname: str | Path,
106105
method: str,
107106
label: str,
108107
author: str,

mne_icalabel/config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
from .iclabel import iclabel_label_components
66

77
if TYPE_CHECKING:
8-
from typing import Callable, Optional
8+
from collections.abc import Callable
99

10-
ICALABEL_METHODS: dict[str, Optional[Callable]] = {
10+
ICALABEL_METHODS: dict[str, Callable | None] = {
1111
"iclabel": iclabel_label_components,
1212
"manual": None,
1313
}

mne_icalabel/config.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Callable
1+
from collections.abc import Callable
22

33
from .iclabel import iclabel_label_components as iclabel_label_components
44

0 commit comments

Comments
 (0)