Skip to content

Commit

Permalink
MAINT: Release 1.5 (#197)
Browse files Browse the repository at this point in the history
  • Loading branch information
larsoner authored Aug 15, 2023
1 parent 1b44f08 commit 0472926
Show file tree
Hide file tree
Showing 19 changed files with 183 additions and 148 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.ref }}
cancel-in-progress: true

on:
on: # yamllint disable-line rule:truthy
push:
branches:
- main
tags:
- '*'
- '*'
pull_request:
branches:
- main
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/outdated.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.ref }}
cancel-in-progress: true

on:
on: # yamllint disable-line rule:truthy
# We only do this on PRs to avoid the (admittedly unlikely) scenario that
# we run, green, wait, merge, then the build on `main` could fail because conda
# has updated during the "green" and then the "build on `main`" steps
Expand All @@ -14,9 +14,9 @@ jobs:
deps:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- run: pip install packaging requests pyyaml
- run: python tests/test_outdated.py
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- run: pip install packaging requests pyyaml
- run: python tests/test_outdated.py
2 changes: 1 addition & 1 deletion .github/workflows/purge_artifacts.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: 'Remove all artifacts'

on:
on: # yamllint disable-line rule:truthy
schedule:
- cron: '0 3 * * *' # every night at 3 am UTC

Expand Down
15 changes: 15 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
repos:
- repo: https://github.com/psf/black
rev: 23.7.0
hooks:
- id: black
args: [--quiet]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.284
hooks:
- id: ruff
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.32.0
hooks:
- id: yamllint
args: [--strict, -c, .yamllint.yml]
9 changes: 9 additions & 0 deletions .yamllint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
extends: default

ignore: |
recipes/mne-python_0.23/mne-python_0.23.0_env.yml
rules:
line-length: disable
document-start: disable
key-duplicates: disable
13 changes: 13 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[tool.ruff]
select = ["E", "F", "W", "D"]
ignore = [
"D100", # Missing docstring in public module
"D104", # Missing docstring in public package
]

[tool.ruff.pydocstyle]
convention = "numpy"

[tool.ruff.per-file-ignores]
"tests/test_imports.py" = ["E402", "F401"]
"tests/test_gui.py" = ["E402"]
10 changes: 5 additions & 5 deletions recipes/mne-python_0.23/construct.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ company: MNE-Python Developers
environment_file: mne-python_0.23.0_env.yml
license_file: ../../LICENSE

initialize_by_default: False
register_python_default: False
initialize_by_default: false
register_python_default: false
default_prefix: ${HOME}/mne-python/0.23.0 # [unix]
default_prefix: ${USERPROFILE}\mne-python\0.23.0 # [win]
uninstall_name: MNE-Python 0.23.0 (${VERSION}, Python ${PYVERSION})
Expand All @@ -17,9 +17,9 @@ installer_filename: MNE-Python-0.23.0_installer-2021.1-Windows.exe # [win]
installer_filename: MNE-Python-0.23.0_installer-2021.1-Linux.sh # [linux]

channels:
- conda-forge
- conda-forge

conda_default_channels:
- conda-forge
- conda-forge

write_condarc: True
write_condarc: true
6 changes: 3 additions & 3 deletions recipes/mne-python_0.24/construct.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ welcome_file: ../../assets/welcome.rtf
readme_text: ""
conclusion_file: ../../assets/conclusion.rtf

initialize_by_default: False
register_python_default: False
initialize_by_default: false
register_python_default: false

# default_prefix will be ignored by macOS .pkg installer!
default_prefix: ${HOME}/mne-python/0.24.1_2 # [unix]
Expand Down Expand Up @@ -83,5 +83,5 @@ condarc:
# default_channels:
# - conda-forge
channel_priority: strict
allow_other_channels: False
allow_other_channels: false
env_prompt: (mne-0.24.1_2)
6 changes: 3 additions & 3 deletions recipes/mne-python_1.0/construct.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ welcome_file: ../../assets/welcome.rtf
readme_text: ""
conclusion_file: ../../assets/conclusion.rtf

initialize_by_default: False
register_python_default: False
initialize_by_default: false
register_python_default: false

# default_prefix will be ignored by macOS .pkg installer!
default_prefix: ${HOME}/mne-python/1.0.3_1 # [linux]
Expand Down Expand Up @@ -128,5 +128,5 @@ condarc:
channels:
- conda-forge
channel_priority: strict
allow_other_channels: False
allow_other_channels: false
env_prompt: "(mne-1.0.3_1) "
6 changes: 3 additions & 3 deletions recipes/mne-python_1.1/construct.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ welcome_file: ../../assets/welcome.rtf
readme_text: ""
conclusion_file: ../../assets/conclusion.rtf

initialize_by_default: False
register_python_default: False
initialize_by_default: false
register_python_default: false

# default_prefix will be ignored by macOS .pkg installer!
default_prefix: ${HOME}/mne-python/1.1.1_0 # [linux]
Expand Down Expand Up @@ -131,5 +131,5 @@ condarc:
channels:
- conda-forge
channel_priority: strict
allow_other_channels: False
allow_other_channels: false
env_prompt: "(mne-1.1.1_0) "
6 changes: 3 additions & 3 deletions recipes/mne-python_1.2/construct.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ welcome_file: ../../assets/welcome.rtf
readme_text: ""
conclusion_file: ../../assets/conclusion.rtf

initialize_by_default: False
register_python_default: False
initialize_by_default: false
register_python_default: false

# default_prefix will be ignored by macOS .pkg installer!
default_prefix: ${HOME}/mne-python/1.2.3_0 # [linux]
Expand Down Expand Up @@ -136,5 +136,5 @@ condarc:
channels:
- conda-forge
channel_priority: strict
allow_other_channels: False
allow_other_channels: false
env_prompt: "(mne-1.2.3_0) "
6 changes: 3 additions & 3 deletions recipes/mne-python_1.3/construct.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ welcome_file: ../../assets/welcome.rtf
readme_text: ""
conclusion_file: ../../assets/conclusion.rtf

initialize_by_default: False
register_python_default: False
initialize_by_default: false
register_python_default: false

# default_prefix will be ignored by macOS .pkg installer!
default_prefix: ${HOME}/mne-python/1.3.1_0 # [linux]
Expand Down Expand Up @@ -140,5 +140,5 @@ condarc:
# - pytorch # [win]
- conda-forge
channel_priority: strict
allow_other_channels: False
allow_other_channels: false
env_prompt: "(mne-1.3.1_0) "
6 changes: 3 additions & 3 deletions recipes/mne-python_1.4/construct.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ welcome_file: ../../assets/welcome.rtf
readme_text: ""
conclusion_file: ../../assets/conclusion.rtf

initialize_by_default: False
register_python_default: False
initialize_by_default: false
register_python_default: false

# default_prefix will be ignored by macOS .pkg installer!
default_prefix: ${HOME}/mne-python/1.4.2_0 # [linux]
Expand Down Expand Up @@ -145,5 +145,5 @@ condarc:
# - pytorch # [win]
- conda-forge
channel_priority: strict
allow_other_channels: False
allow_other_channels: false
env_prompt: "(mne-1.4.2_0) "
22 changes: 11 additions & 11 deletions recipes/mne-python_1.5/construct.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ welcome_file: ../../assets/welcome.rtf
readme_text: ""
conclusion_file: ../../assets/conclusion.rtf

initialize_by_default: False
register_python_default: False
initialize_by_default: false
register_python_default: false

default_prefix: ${HOME}/mne-python/1.5.0_0 # [linux]
default_prefix: "%USERPROFILE%\\mne-python\\1.5.0_0" # [win]
Expand Down Expand Up @@ -62,11 +62,11 @@ specs:
# - mne-bids =0.11dev0=*_20221007
# TODO: ⛔️ ⛔️ ⛔️ DEV BUILDS STOP: CHANGE BEFORE RELEASE! ⛔️ ⛔️ ⛔️

- mne =1.4.2=*_0
- mne-installer-menus =1.4.2=*_0
- mne =1.5.0=*_0
- mne-installer-menus =1.5.0=*_0
- mne-bids =0.12.0
- mne-bids-pipeline =1.4.0
- mne-qt-browser =0.5.1
- mne-qt-browser =0.5.2
- mne-connectivity =0.5.0
- mne-faster =1.1.0
- mne-nirs =0.5.0
Expand All @@ -89,8 +89,8 @@ specs:
- mamba =1.4.9
- openblas =0.3.23
- jupyter =1.0.0
- jupyterlab =4.0.3
- ipykernel =6.24.0
- jupyterlab =4.0.5
- ipykernel =6.25.1
- nb_conda_kernels =2.3.1
- spyder-kernels =2.4.4
- spyder =5.4.4
Expand Down Expand Up @@ -128,22 +128,22 @@ specs:
# GitHub client, https://cli.github.com
- gh =2.32.1
# NeuroSpin needs the following
- questionary =1.10.0
- questionary =2.0.0
- pqdm =0.2.0
# Viz
- matplotlib =3.7.2
- ipympl =0.9.3
- seaborn =0.12.2
- plotly =5.15.0
- plotly =5.16.0
- vtk =9.2.6
- git =2.41.0 # [win]
- make =4.3 # [win]
- ipywidgets =8.0.7
- ipywidgets =8.1.0

condarc:
channels:
# - pytorch # [win]
- conda-forge
channel_priority: strict
allow_other_channels: False
allow_other_channels: false
env_prompt: "(mne-1.5.0_0) "
32 changes: 16 additions & 16 deletions tests/test_gui.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
print('Running imports')
print("Running imports")
import faulthandler

faulthandler.enable()
Expand All @@ -8,7 +8,6 @@
from pathlib import Path

import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import pyvista

Expand All @@ -17,17 +16,17 @@
this_path = Path(__file__).parent

# Matplotlib
print('Running matplotlib tests')
print("Running matplotlib tests")
fig, _ = plt.subplots()
want = 'QTAgg'
want = "QTAgg"
assert want in repr(fig.canvas), repr(fig.canvas)
plt.close('all')
plt.close("all")

# pyvistaqt
print('Running pyvistaqt tests (except Windows)')
if not sys.platform.startswith('win'):
fname = this_path / 'test.png'
mne.viz.set_3d_backend('pyvista')
print("Running pyvistaqt tests (except Windows)")
if not sys.platform.startswith("win"):
fname = this_path / "test.png"
mne.viz.set_3d_backend("pyvista")
fig = mne.viz.create_3d_figure((400, 400), scene=False, show=True)
fig._process_events()
fig._process_events()
Expand All @@ -42,21 +41,22 @@
assert fname.is_file()
os.remove(fname)
mne.viz.close_3d_figure(fig)
assert 'BackgroundPlotter' in repr(plotter), repr(plotter)
assert "BackgroundPlotter" in repr(plotter), repr(plotter)

# mne-qt-browser
print('Running mne-qt-browser tests')
mne.viz.set_browser_backend('qt')
raw = mne.io.RawArray(np.zeros((1, 1000)), mne.create_info(1, 1000., 'eeg'))
print("Running mne-qt-browser tests")
mne.viz.set_browser_backend("qt")
raw = mne.io.RawArray(np.zeros((1, 1000)), mne.create_info(1, 1000.0, "eeg"))
fig = raw.plot()
fig.close()
assert 'MNEQtBrowser' in repr(fig), repr(fig)
assert "MNEQtBrowser" in repr(fig), repr(fig)

# mne-kit-gui
print('Running mne-kit-gui tests')
print("Running mne-kit-gui tests")
from pyface.api import GUI # noqa
import mne_kit_gui # noqa
os.environ['_MNE_GUI_TESTING_MODE'] = 'true'

os.environ["_MNE_GUI_TESTING_MODE"] = "true"
gui = GUI()
gui.process_events()
ui, frame = mne_kit_gui.kit2fiff()
Expand Down
18 changes: 13 additions & 5 deletions tests/test_imports.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,35 @@


def check_min_version(package, min_version):
"""Check a minimum version."""
from packaging.version import parse
assert parse(package.__version__) >= parse(min_version), f'{package}: got {package.__version__} wanted {min_version}'

assert parse(package.__version__) >= parse(
min_version
), f"{package}: got {package.__version__} wanted {min_version}"


import mne
check_min_version(mne, '1.4')

check_min_version(mne, "1.4")
import mne_bids
import mne_bids_pipeline
check_min_version(mne_bids_pipeline, '1.2')

check_min_version(mne_bids_pipeline, "1.2")
import mne_connectivity
import mne_faster
import mne_nirs
import mne_qt_browser
check_min_version(mne_qt_browser, '0.5.0')

check_min_version(mne_qt_browser, "0.5.0")
import mne_realtime
import mne_features
import mne_rsa
import mne_microstates
import mne_ari
import mne_kit_gui
if platform.system() != 'Windows':

if platform.system() != "Windows":
import mne_icalabel
import autoreject
import pyprep
Expand Down
Loading

0 comments on commit 0472926

Please sign in to comment.