Skip to content

Commit 058a356

Browse files
committed
STY: Apply black
1 parent f882519 commit 058a356

File tree

9 files changed

+1399
-1184
lines changed

9 files changed

+1399
-1184
lines changed

.github/workflows/qt_viz_tests.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ name: CIs
22
concurrency:
33
group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.type }}
44
cancel-in-progress: true
5-
on:
6-
pull_request:
7-
push:
8-
branches: [main]
9-
schedule:
10-
- cron: "0 4 * * 1" # At 04:00 on Monday
5+
on: # yamllint disable-line rule:truthy
6+
pull_request:
7+
push:
8+
branches: [main]
9+
schedule:
10+
- cron: "0 4 * * 1" # At 04:00 on Monday
1111

1212
jobs:
1313
pytest:

.github/workflows/release.yml

+20-20
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Upload a Python Package using Twine when a release is created
22

33
name: Build
4-
on:
4+
on: # yamllint disable-line rule:truthy
55
release:
66
types: [published]
77
push:
@@ -18,22 +18,22 @@ jobs:
1818
package:
1919
runs-on: ubuntu-latest
2020
steps:
21-
- uses: actions/checkout@v3
22-
- name: Set up Python
23-
uses: actions/setup-python@v4
24-
with:
25-
python-version: '3.10'
26-
- name: Install dependencies
27-
run: |
28-
python -m pip install --upgrade pip
29-
pip install build twine
30-
- name: Build package
31-
run: python -m build --sdist --wheel
32-
- name: Check package
33-
run: twine check --strict dist/*
34-
- name: Publish to PyPI
35-
uses: pypa/gh-action-pypi-publish@release/v1
36-
with:
37-
user: __token__
38-
password: ${{ secrets.PYPI_PASSWORD }}
39-
if: github.event_name == 'release'
21+
- uses: actions/checkout@v3
22+
- name: Set up Python
23+
uses: actions/setup-python@v4
24+
with:
25+
python-version: '3.10'
26+
- name: Install dependencies
27+
run: |
28+
python -m pip install --upgrade pip
29+
pip install build twine
30+
- name: Build package
31+
run: python -m build --sdist --wheel
32+
- name: Check package
33+
run: twine check --strict dist/*
34+
- name: Publish to PyPI
35+
uses: pypa/gh-action-pypi-publish@release/v1
36+
with:
37+
user: __token__
38+
password: ${{ secrets.PYPI_PASSWORD }}
39+
if: github.event_name == 'release'

codecov.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ github_checks: # too noisy, even though "a" interactively disables them
44

55
codecov:
66
notify:
7-
require_ci_to_pass: no
7+
require_ci_to_pass: false
88

99
coverage:
1010
status:

mne_qt_browser/__init__.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
try:
22
from importlib.metadata import version
3+
34
__version__ = version("mne_qt_browser")
45
except Exception:
56
try:
67
from ._version import __version__ # written by setuptools_scm
78
except ImportError:
8-
__version__ = '0.0.0'
9+
__version__ = "0.0.0"
910

1011
# All created brower-instances are listed here for a reference to avoid having
1112
# them garbage-collected prematurely.

mne_qt_browser/_fixes.py

+17-11
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,19 @@
1616
try:
1717
from mne.viz.backends._utils import _qt_raise_window
1818
except ImportError:
19+
1920
def _qt_raise_window(win):
2021
try:
2122
from matplotlib import rcParams
22-
raise_window = rcParams['figure.raise_window']
23+
24+
raise_window = rcParams["figure.raise_window"]
2325
except ImportError:
2426
raise_window = True
2527
if raise_window:
2628
win.activateWindow()
2729
win.raise_()
2830

31+
2932
try:
3033
from mne.viz.backends._utils import _init_mne_qtapp
3134
except ImportError:
@@ -51,46 +54,49 @@ def _init_mne_qtapp(enable_icon=True, pg_app=False):
5154
from qtpy.QtWidgets import QApplication
5255
from qtpy.QtGui import QIcon
5356

54-
app_name = 'MNE-Python'
55-
organization_name = 'MNE'
57+
app_name = "MNE-Python"
58+
organization_name = "MNE"
5659

5760
# Fix from cbrnr/mnelab for app name in menu bar
5861
if sys.platform.startswith("darwin"):
5962
try:
6063
# set bundle name on macOS (app name shown in the menu bar)
6164
from Foundation import NSBundle
65+
6266
bundle = NSBundle.mainBundle()
63-
info = (bundle.localizedInfoDictionary()
64-
or bundle.infoDictionary())
67+
info = bundle.localizedInfoDictionary() or bundle.infoDictionary()
6568
info["CFBundleName"] = app_name
6669
except ModuleNotFoundError:
6770
pass
6871

6972
if pg_app:
7073
from pyqtgraph import mkQApp
74+
7175
app = mkQApp(app_name)
7276
else:
73-
app = (QApplication.instance()
74-
or QApplication(sys.argv or [app_name]))
77+
app = QApplication.instance() or QApplication(sys.argv or [app_name])
7578
app.setApplicationName(app_name)
7679
app.setOrganizationName(organization_name)
7780

7881
if enable_icon:
7982
# Set icon
8083
_init_qt_resources()
81-
kind = 'bigsur-' if platform.mac_ver()[0] >= '10.16' else ''
84+
kind = "bigsur-" if platform.mac_ver()[0] >= "10.16" else ""
8285
app.setWindowIcon(QIcon(f":/mne-{kind}icon.png"))
8386

8487
return app
8588

89+
8690
###############################################################################
8791
# pytestqt
8892
try:
8993
from pytestqt.exceptions import capture_exceptions
9094
except ImportError:
91-
logger.debug('If pytest-qt is not installed, the errors from inside '
92-
'the Qt-loop will be occluded and it will be harder '
93-
'to trace back the cause.')
95+
logger.debug(
96+
"If pytest-qt is not installed, the errors from inside "
97+
"the Qt-loop will be occluded and it will be harder "
98+
"to trace back the cause."
99+
)
94100

95101
@contextmanager
96102
def capture_exceptions():

0 commit comments

Comments
 (0)