Skip to content

Commit

Permalink
Add Python 3.12 to CIs (#147)
Browse files Browse the repository at this point in the history
* add python 3.12

* add branch trigger

* add warning filter

* fix

* add missing keys

* skip onnxruntime test on windows-latest

* fix imports

---------

Signed-off-by: Adam Li <[email protected]>
Co-authored-by: Adam Li <[email protected]>
  • Loading branch information
mscheltienne and adam2392 authored Mar 9, 2024
1 parent 52dd20b commit edc561c
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/pytest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ concurrency:
on: # yamllint disable-line rule:truthy
pull_request:
push:
branches: [main, maint/0.2, maint/0.3, maint/0.4]
branches: [main, maint/0.4, maint/0.5, maint/0.6]
workflow_dispatch:
schedule:
- cron: '0 8 * * 1'
Expand All @@ -17,7 +17,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu, macos, windows]
python-version: [3.9, "3.10", "3.11"]
python-version: [3.9, "3.10", "3.11", "3.12"]
name: ${{ matrix.os }} - py${{ matrix.python-version }}
runs-on: ${{ matrix.os }}-latest
defaults:
Expand Down
4 changes: 4 additions & 0 deletions mne_icalabel/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ def pytest_configure(config):
ignore:Setting non-standard config type.*:RuntimeWarning
# pandas 3.0 will require pyarrow
ignore:\n*Pyarrow will become a required dependency of pandas.*:DeprecationWarning
# Python 3.12+ gives a deprecation warning if TarFile.extraction_filter is None
ignore:Python 3\.14 will, by default, filter extracted tar.*:DeprecationWarning
# onnxruntime on windows runners
ignore:Unsupported Windows version.*:UserWarning
"""
for warning_line in warnings_lines.split("\n"):
warning_line = warning_line.strip()
Expand Down
2 changes: 1 addition & 1 deletion mne_icalabel/iclabel/network/tests/test_network.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from importlib.resources import files # type: ignore
from importlib.resources import files

import numpy as np
import pytest
Expand Down
5 changes: 3 additions & 2 deletions mne_icalabel/iclabel/tests/test_label_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,9 @@ def test_warnings():
random_state=101,
)
ica.fit(raw)
with pytest.warns(RuntimeWarning, match="common average reference"), pytest.warns(
RuntimeWarning, match="not filtered between 1 and 100 Hz"
with (
pytest.warns(RuntimeWarning, match="common average reference"),
pytest.warns(RuntimeWarning, match="not filtered between 1 and 100 Hz"),
):
iclabel_label_components(raw, ica)
with raw.info._unlock():
Expand Down
6 changes: 5 additions & 1 deletion mne_icalabel/utils/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,13 @@ def sys_info(fid: Optional[IO] = None, developer: bool = False):
keys = (
"build",
"doc",
"test",
"gui",
"ica",
"onnx",
"stubs",
"style",
"test",
"torch",
)
for key in keys:
extra_dependencies = [
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ classifiers = [
'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3.9',
'Topic :: Scientific/Engineering',
'Topic :: Software Development',
Expand Down

0 comments on commit edc561c

Please sign in to comment.