Skip to content

Commit cb25a42

Browse files
committed
MAINT: Switch to pip for macOS jobs
1 parent eb0758a commit cb25a42

5 files changed

Lines changed: 43 additions & 28 deletions

File tree

.github/workflows/tests.yml

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
persist-credentials: false
3131
- uses: actions/setup-python@v6
3232
with:
33-
python-version: '3.13'
33+
python-version: '3.14'
3434
- uses: pre-commit/action@v3.0.1
3535
- run: pip install mypy numpy scipy vulture
3636
- run: mypy
@@ -77,11 +77,11 @@ jobs:
7777
python: '3.13'
7878
kind: conda
7979
- os: macos-latest # arm64 (Apple Silicon): Sequoia
80-
python: '3.13'
81-
kind: mamba
80+
python: '3.14'
81+
kind: pip
8282
- os: macos-15-intel # intel: Sequoia
8383
python: '3.13'
84-
kind: mamba
84+
kind: pip
8585
- os: windows-latest
8686
python: '3.11'
8787
kind: mamba
@@ -123,31 +123,16 @@ jobs:
123123
with:
124124
python-version: ${{ matrix.python }}
125125
if: startswith(matrix.kind, 'pip')
126+
id: setup-python
127+
# Workaround macOS path behavior with login shells (which puts system Python first)
128+
- run: echo "export PATH=\"$(dirname ${{ steps.setup-python.outputs.python-path }}):$PATH\"" | tee -a ~/.bash_profile # zizmor: ignore[template-injection]
129+
if: startswith(matrix.kind, 'pip') && startswith(matrix.os, 'macos')
126130
# Python (if conda)
127-
- name: Fixes for conda
128-
run: |
129-
# For some reason on Linux we get crashes
130-
if [[ "$RUNNER_OS" == "Linux" ]]; then
131-
sed -i "/numba/d" environment.yml
132-
fi
133-
# And on Windows and macOS PySide6.9.0 segfaults
134-
if [[ "$RUNNER_OS" == "macOS" ]]; then
135-
sed -i "" "s/ - PySide6 .*/ - PySide6 =6.9.2/g" environment.yml
136-
sed -i "" "s/ - vtk .*/ - vtk =9.5.1/g" environment.yml
137-
138-
else
139-
sed -i "s/ - PySide6 .*/ - PySide6 =6.9.2/g" environment.yml
140-
sed -i "s/ - vtk .*/ - vtk =9.5.1/g" environment.yml
141-
if [[ "$RUNNER_OS" == "Windows" ]]; then
142-
echo "MNE_IS_OSMESA=true" | tee -a $GITHUB_ENV
143-
fi
144-
fi
145-
if: matrix.kind == 'conda' || matrix.kind == 'mamba'
146131
- uses: mamba-org/setup-micromamba@v3
147132
with:
148133
environment-file: ${{ env.CONDA_ENV }}
149134
environment-name: mne
150-
log-level: ${{ runner.debug == '1' && 'debug' || 'info' }}
135+
log-level: 'info'
151136
create-args: >-
152137
python=${{ env.PYTHON_VERSION }}
153138
-v
@@ -162,6 +147,7 @@ jobs:
162147
**/pylock.ci-old.toml
163148
python-version: ${{ matrix.python }}
164149
if: matrix.kind == 'old'
150+
- run: bash ./tools/github_actions_verify_python.sh
165151
- run: bash ./tools/github_actions_dependencies.sh
166152
- run: python ./tools/github_actions_check_old_env.py
167153
if: matrix.kind == 'old'

environment.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ dependencies:
4343
- pyarrow
4444
- pybv
4545
- pymatreader
46-
- PySide6 !=6.9.1
46+
- PySide6 ==6.10.2
4747
- python-neo
4848
- python-picard >=0.4
4949
- pyvista >=0.43
@@ -61,7 +61,7 @@ dependencies:
6161
- trame
6262
- trame-vtk
6363
- trame-vuetify
64-
- vtk >=9.2
64+
- vtk ==9.6.1
6565
- xlrd
6666
- pip:
6767
- nest-asyncio2

tools/github_actions_dependencies.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
set -eo pipefail
44

55
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
6+
ONLY_BINARY_ARG="--only-binary=numpy,scipy,matplotlib,numba,llvmlite,antio"
67
STD_ARGS="--progress-bar off --upgrade"
78
INSTALL_ARGS="-e"
89
if [ ! -z "$CONDA_ENV" ]; then
@@ -61,6 +62,6 @@ else
6162
echo "::group::Installing MNE in development mode using pip"
6263
fi
6364
set -x
64-
python -m pip install $STD_ARGS $INSTALL_ARGS .$EXTRAS $GROUP_ARG
65+
python -m pip install $STD_ARGS $ONLY_BINARY_ARG $INSTALL_ARGS .$EXTRAS $GROUP_ARG
6566
set +x
6667
echo "::endgroup::"
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/bash -ef
2+
3+
set -eo pipefail
4+
5+
GOT_PYTHON=$(which python)
6+
echo "Checking Python at:
7+
echo " which python=${GOT_PYTHON}
8+
echo "for"
9+
echo " MNE_CI_KIND=${MNE_CI_KIND}"
10+
if [[ "${MNE_CI_KIND}" == "conda" ]] || [[ "${MNE_CI_KIND}" == "mamba" ]]; then
11+
WANT="micromamba/envs/mne"
12+
elif [[ "${MNE_CI_KIND}" == "old" ]]; then
13+
WANT="mne-python/mne-python/.venv/bin"
14+
elif [[ "${MNE_CI_KIND}" == "pip" ]] || [[ "${MNE_CI_KIND}" == "pip-pre" ]]; then
15+
WANT="hostedtoolcache/Python"
16+
else
17+
echo "ERROR: Unrecognized MNE_CI_KIND=${MNE_CI_KIND}"
18+
exit 1
19+
fi
20+
if [[ "${GOT_PYTHON}" != *"${WANT}"* ]]; then
21+
echo "ERROR: Did not find \"${WANT}\" from PATH:"
22+
tr ':' '\n' <<< "$PATH"
23+
exit 1
24+
else
25+
echo "OK: Found expected \"${WANT}\""
26+
fi

tools/hooks/update_environment_file.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ def split_dep(dep):
5757
# `environment.yaml` breaks the solver. 6.9.1 has a bug, and 6.9.2 needs newer
5858
# C deps that mean we need to upgrade VTK etc.
5959
if package_name == "PySide6":
60-
version_spec = "!=6.9.1"
60+
version_spec = "==6.10.2"
61+
if package_name == "vtk":
62+
version_spec = "==9.6.1"
6163
# rstrip output line in case `version_spec` == ""
6264
line = f" - {package_name} {version_spec}".rstrip()
6365
# use pip for packages needing e.g. `platform_system` or `python_version` triaging

0 commit comments

Comments
 (0)