Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions mne/viz/backends/_qt.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,13 @@
os.environ.setdefault("QT_MAC_WANTS_LAYER", "1")


def _qcursor(name):
# map to a native name on macOS (instead of using Qt pixmap)
if sys.platform == "darwin" and name in ("WaitCursor", "BusyCursor"):
name = "ForbiddenCursor"
return QCursor(getattr(Qt, name))


# fix for qscroll needing two layouts, one parent, one child
def _get_layout(layout):
if hasattr(layout, "_parent_layout"):
Expand Down Expand Up @@ -885,7 +892,7 @@ def func(button):
button_id = widget.standardButton(button)
for button_name in _QtDialog.supported_button_names:
if button_id == getattr(QMessageBox, button_name):
widget.setCursor(QCursor(Qt.WaitCursor))
widget.setCursor(_qcursor("WaitCursor"))
try:
callback(button_name)
finally:
Expand Down Expand Up @@ -1563,7 +1570,7 @@ def _window_set_cursor(self, cursor):
self._window.setCursor(cursor)

def _window_new_cursor(self, name):
return QCursor(getattr(Qt, name))
return _qcursor(name)

@contextmanager
def _window_ensure_minimum_sizes(self):
Expand Down
43 changes: 5 additions & 38 deletions tools/github_actions_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,16 @@
set -eo pipefail

if [[ "${CI_OS_NAME}" == "ubuntu"* ]]; then
CONDITIONS=("not (ultraslowtest or pgtest)")
CONDITION="not (ultraslowtest or pgtest)"
elif [[ "${CI_OS_NAME}" == "macos"* ]]; then
# detect arch and run slowtest on arm64 only (pgtest is already ultraslow on macOS)
if [[ "$(uname -m)" == "arm64" ]]; then
# Split the PyVista/VTK ("pvtest") tests into their own xdist invocation.
# Run all together, a worker that accumulates heavy state (loky pools,
# leftover ipykernel/jupyter_client asyncio loops, tqdm monitors) creates
# the scheduling jitter that trips an xdist loadscope dispatch deadlock at
# end-of-run: workers idle in TestQueue.get, controller loops forever in
# dsession.loop_once without dispatching the remaining scopes or SHUTDOWN
# (see pytest-xdist#1313). Two shorter, lighter invocations avoid it while
# keeping parallelism; pvtest alone under xdist does not hang.
CONDITIONS=("not (ultraslowtest or pgtest or pvtest)" "pvtest and not ultraslowtest")
CONDITION="not (ultraslowtest or pgtest)"
else
CONDITIONS=("not (slowtest or pgtest)")
CONDITION="not (slowtest or pgtest)"
fi
elif [[ "${CI_OS_NAME}" == "windows"* ]]; then
CONDITIONS=("not (slowtest or pgtest)")
CONDITION="not (slowtest or pgtest)"
else
echo "✕ ERROR: Unrecognized CI_OS_NAME=${CI_OS_NAME}"
exit 1
Expand Down Expand Up @@ -53,29 +45,4 @@ if [[ ! -z "$CONDA_ENV" ]] && [[ "${CI_OS_NAME}" != "windows"* ]] && [[ "${MNE_C
fi

# $COV_ARGS is set in github_actions_env_vars.sh (coverage only on Python >= 3.14)
# Run each marker expression as its own pytest invocation (usually just one; on
# macOS arm64 the pvtest tests are split out, see above). Later runs append
# coverage, each gets its own junit file, and we run them all before exiting
# with the first nonzero code so one failing split does not mask the other.
set +e # capture each pytest's exit code manually rather than aborting on it
CODE=0
COV_APPEND=""
i=0
for CONDITION in "${CONDITIONS[@]}"; do
if [ "${#CONDITIONS[@]}" -gt 1 ]; then
THIS_JUNIT="${JUNIT_PATH%.xml}-${i}.xml"
else
THIS_JUNIT="$JUNIT_PATH"
fi
set -x
pytest -m "${CONDITION}" -n "$PYTEST_XDIST_N" --dist loadscope --timeout=120 --timeout-method=thread -o faulthandler_timeout=110 ${COV_ARGS} ${COV_APPEND} --color=yes --continue-on-collection-errors --junit-xml="$THIS_JUNIT" -vv ${USE_DIRS}
THIS_CODE=$?
set +x
echo "Exited with code $THIS_CODE for: ${CONDITION}"
if [ "$THIS_CODE" -ne 0 ] && [ "$CODE" -eq 0 ]; then
CODE=$THIS_CODE
fi
COV_APPEND="--cov-append"
i=$((i + 1))
done
exit $CODE
pytest -m "${CONDITION}" -n "$PYTEST_XDIST_N" --dist loadscope --timeout=120 --timeout-method=thread -o faulthandler_timeout=110 ${COV_ARGS} --color=yes --continue-on-collection-errors --junit-xml="$JUNIT_PATH" -vv ${USE_DIRS}
Loading