Skip to content

Commit 6485b1b

Browse files
authored
MAINT: Switch to pip for macOS and minimal jobs (#13882)
1 parent 6f2f8af commit 6485b1b

14 files changed

Lines changed: 144 additions & 146 deletions

.github/workflows/tests.yml

Lines changed: 15 additions & 31 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
@@ -76,15 +76,12 @@ jobs:
7676
- os: ubuntu-latest
7777
python: '3.13'
7878
kind: conda
79-
- os: macos-latest # arm64 (Apple Silicon): Sequoia
80-
python: '3.13'
81-
kind: mamba
82-
- os: macos-15-intel # intel: Sequoia
79+
- os: macos-latest # arm64
80+
python: '3.14'
81+
kind: pip
82+
- os: macos-15-intel # Intel
8383
python: '3.13'
84-
kind: mamba
85-
- os: windows-latest
86-
python: '3.11'
87-
kind: mamba
84+
kind: pip
8885
- os: ubuntu-latest
8986
python: '3.12'
9087
kind: minimal
@@ -122,36 +119,21 @@ jobs:
122119
- uses: actions/setup-python@v6
123120
with:
124121
python-version: ${{ matrix.python }}
125-
if: startswith(matrix.kind, 'pip')
122+
if: startswith(matrix.kind, 'pip') || matrix.kind == 'minimal'
123+
id: setup-python
124+
# Workaround macOS path behavior with login shells (which puts system Python first)
125+
- run: echo "export PATH=\"$(dirname ${{ steps.setup-python.outputs.python-path }}):$PATH\"" | tee -a ~/.bash_profile # zizmor: ignore[template-injection]
126+
if: startswith(matrix.kind, 'pip') && startswith(matrix.os, 'macos')
126127
# 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'
146128
- uses: mamba-org/setup-micromamba@v3
147129
with:
148130
environment-file: ${{ env.CONDA_ENV }}
149131
environment-name: mne
150-
log-level: ${{ runner.debug == '1' && 'debug' || 'info' }}
132+
log-level: 'info'
151133
create-args: >-
152134
python=${{ env.PYTHON_VERSION }}
153135
-v
154-
if: matrix.kind == 'conda' || matrix.kind == 'mamba'
136+
if: matrix.kind == 'conda'
155137
timeout-minutes: 20
156138
# Python (if old)
157139
- uses: astral-sh/setup-uv@v8.1.0
@@ -162,7 +144,9 @@ jobs:
162144
**/pylock.ci-old.toml
163145
python-version: ${{ matrix.python }}
164146
if: matrix.kind == 'old'
147+
- run: bash ./tools/github_actions_verify_python.sh "${{ matrix.python }}"
165148
- run: bash ./tools/github_actions_dependencies.sh
149+
timeout-minutes: 10
166150
- run: python ./tools/github_actions_check_old_env.py
167151
if: matrix.kind == 'old'
168152
# Minimal commands on Linux (macOS stalls)

azure-pipelines.yml

Lines changed: 11 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ stages:
8282
variables:
8383
AZURE_CI: 'true'
8484
jobs:
85-
- job: Ultraslow_PG
85+
- job: Linux_Ultraslow_PG
8686
pool:
87-
vmImage: 'ubuntu-22.04'
87+
vmImage: 'ubuntu-latest'
8888
variables:
8989
DISPLAY: ':99'
9090
OPENBLAS_NUM_THREADS: '1'
@@ -93,7 +93,7 @@ stages:
9393
MNE_BROWSER_PRECOMPUTE: 'false'
9494
steps:
9595
- bash: |
96-
set -e
96+
set -eo pipefail
9797
./tools/setup_xvfb.sh
9898
sudo apt install -yq tcsh
9999
displayName: 'Install Ubuntu dependencies'
@@ -112,19 +112,19 @@ stages:
112112
addToPath: true
113113
displayName: 'Get Python'
114114
- bash: |
115-
set -e
115+
set -eo pipefail
116116
python -m pip install --progress-bar off --upgrade pip
117117
python -m pip install --progress-bar off "mne-qt-browser[opengl] @ git+https://github.com/mne-tools/mne-qt-browser.git" pyvista scikit-learn python-picard qtpy nibabel sphinx-gallery "PySide6!=6.8.0,!=6.8.0.1,!=6.8.1.1,!=6.9.1" pandas neo pymatreader antio defusedxml curryreader pymef
118118
python -m pip uninstall -yq mne
119119
python -m pip install --progress-bar off --upgrade -e . --group=test
120120
displayName: 'Install dependencies with pip'
121121
- bash: |
122-
set -e
122+
set -eo pipefail
123123
mne sys_info -pd
124124
mne sys_info -pd | grep "qtpy .*(PySide6=.*)$"
125125
displayName: Print config
126126
- bash: |
127-
set -e
127+
set -eo pipefail
128128
LD_DEBUG=libs python -c "from PySide6.QtWidgets import QApplication, QWidget; app = QApplication([]); import matplotlib; matplotlib.use('QtAgg'); import matplotlib.pyplot as plt; plt.figure()"
129129
- bash: source tools/get_testing_version.sh
130130
displayName: 'Get testing version'
@@ -141,19 +141,10 @@ stages:
141141
- bash: bash <(curl -s https://codecov.io/bash)
142142
displayName: 'Codecov'
143143
condition: succeededOrFailed()
144-
- task: PublishTestResults@2
145-
inputs:
146-
testResultsFiles: '**/junit-*.xml'
147-
testRunTitle: 'Publish test results for $(Agent.JobName)'
148-
failTaskOnFailedTests: true
149-
condition: succeededOrFailed()
150-
- task: PublishCodeCoverageResults@2
151-
inputs:
152-
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml'
153144

154-
- job: Qt
145+
- job: Linux_Qt_Bindings
155146
pool:
156-
vmImage: 'ubuntu-22.04'
147+
vmImage: 'ubuntu-latest'
157148
variables:
158149
DISPLAY: ':99'
159150
OPENBLAS_NUM_THREADS: '1'
@@ -169,7 +160,7 @@ stages:
169160
addToPath: true
170161
displayName: 'Get Python'
171162
- bash: |
172-
set -e
163+
set -eo pipefail
173164
python -m pip install --progress-bar off --upgrade pip
174165
python -m pip install --progress-bar off --upgrade --pre --only-binary=\"numpy,scipy,matplotlib,vtk\" numpy scipy matplotlib vtk
175166
python -c "import vtk"
@@ -223,15 +214,6 @@ stages:
223214
- bash: bash <(curl -s https://codecov.io/bash)
224215
displayName: 'Codecov'
225216
condition: succeededOrFailed()
226-
- task: PublishTestResults@2
227-
inputs:
228-
testResultsFiles: '**/junit-*.xml'
229-
testRunTitle: 'Publish test results for $(Agent.JobName)'
230-
failTaskOnFailedTests: true
231-
condition: succeededOrFailed()
232-
- task: PublishCodeCoverageResults@2
233-
inputs:
234-
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml'
235217

236218
- job: Windows
237219
pool:
@@ -250,9 +232,9 @@ stages:
250232
strategy:
251233
maxParallel: 4
252234
matrix:
253-
3.10 pip:
235+
3.11 pip:
254236
TEST_MODE: 'pip'
255-
PYTHON_VERSION: '3.10'
237+
PYTHON_VERSION: '3.11'
256238
3.13 pip pre:
257239
TEST_MODE: 'pip-pre'
258240
PYTHON_VERSION: '3.13'
@@ -292,12 +274,3 @@ stages:
292274
- bash: bash <(curl -s https://codecov.io/bash)
293275
displayName: 'Codecov'
294276
condition: succeededOrFailed()
295-
- task: PublishTestResults@2
296-
inputs:
297-
testResultsFiles: '**/junit-*.xml'
298-
testRunTitle: 'Publish test results for $(Agent.JobName) $(TEST_MODE) $(PYTHON_VERSION)'
299-
failTaskOnFailedTests: true
300-
condition: succeededOrFailed()
301-
- task: PublishCodeCoverageResults@2
302-
inputs:
303-
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml'

environment.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ channels:
55
dependencies:
66
- python >=3.10
77
- antio >=0.5.0
8+
- conda
89
- curryreader >=0.1.2
910
- darkdetect
1011
- decorator >=5.1
@@ -29,9 +30,11 @@ dependencies:
2930
- matplotlib >=3.8
3031
- mffpy >=0.5.7
3132
- mne-qt-browser
33+
- nest-asyncio2
3234
- nibabel >=2.0
3335
- nilearn
3436
- nomkl
37+
- noqt5
3538
- numba >=0.35
3639
- numpy >=1.26,<3
3740
- openmeeg >=2.5.7
@@ -43,7 +46,7 @@ dependencies:
4346
- pyarrow
4447
- pybv
4548
- pymatreader
46-
- PySide6 !=6.9.1
49+
- PySide6 ==6.10.2
4750
- python-neo
4851
- python-picard >=0.4
4952
- pyvista >=0.43
@@ -61,9 +64,8 @@ dependencies:
6164
- trame
6265
- trame-vtk
6366
- trame-vuetify
64-
- vtk >=9.2
67+
- vtk ==9.6.0
6568
- xlrd
6669
- pip:
67-
- nest-asyncio2
6870
- pymef
6971
- pyobjc-framework-Cocoa >=5.2.0;platform_system=='Darwin'

mne/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ def pytest_configure(config: pytest.Config):
213213
# VTK <-> NumPy 2.5 (https://gitlab.kitware.com/vtk/vtk/-/merge_requests/12796)
214214
# nitime <-> NumPy 2.5 (https://github.com/nipy/nitime/pull/236)
215215
ignore:Setting the shape on a NumPy array has been deprecated.*:DeprecationWarning
216+
ignore:Implicitly cleaning up.*:ResourceWarning
216217
""" # noqa: E501
217218
for warning_line in warning_lines.split("\n"):
218219
warning_line = warning_line.strip()

mne/tests/test_source_estimate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1983,7 +1983,7 @@ def test_scale_morph_labels(kind, scale, monkeypatch, tmp_path):
19831983
min_, max_ = 0.72, 0.76
19841984
else:
19851985
# min_, max_ = 0.84, 0.855 # zooms='auto' values
1986-
min_, max_ = 0.46, 0.63
1986+
min_, max_ = 0.44, 0.63
19871987
assert min_ < corr <= max_, scale
19881988
else:
19891989
assert_allclose(label_tc, label_tc_to_morph, atol=1e-12, rtol=1e-12)

mne/viz/tests/test_evoked.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,7 @@ def test_plot_white_rank():
373373
evoked.plot_white(cov, rank=rank)
374374

375375

376+
@pytest.mark.slowtest
376377
def test_plot_white():
377378
"""Test plot_white."""
378379
cov = read_cov(cov_fname)

tools/environment_minimal.yml

Lines changed: 0 additions & 15 deletions
This file was deleted.

tools/get_minimal_commands.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,4 +79,3 @@ which mne_surf2bem
7979
mne_surf2bem --version
8080
which mri_average
8181
mri_average --version
82-
set +x

tools/github_actions_dependencies.sh

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,27 @@
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
910
echo "Uninstalling MNE for CONDA_ENV=${CONDA_ENV}"
10-
# This will fail if mne-base is not in the env (like in our minimal env, so ||true them):
1111
echo "::group::Uninstalling MNE"
12-
conda remove -c conda-forge --force -yq mne-base || true
13-
python -m pip uninstall -y mne || true
12+
conda remove -c conda-forge --force -y mne-base
1413
echo "::endgroup::"
15-
# If using bare environment.yml and not on windows, do a non-editable install
16-
if [[ "${RUNNER_OS}" != "Windows" ]] && [[ "${CONDA_ENV}" != "environment_"* ]]; then
14+
# If not on windows, do a non-editable install
15+
if [[ "${CI_OS_NAME}" != "windows"* ]]; then
1716
INSTALL_ARGS=""
1817
fi
19-
# If on minimal, just install testing deps
20-
if [[ "${MNE_CI_KIND}" == "minimal" ]]; then
21-
GROUP="test"
22-
EXTRAS=""
23-
STD_ARGS="--progress-bar off ${MNE_QT_BACKEND}"
24-
echo "::group::Upgrading pip installation"
25-
python -m pip install --upgrade pip # upgrade pip to support --group
26-
echo "::endgroup::"
27-
else
28-
GROUP="test_extra"
29-
EXTRAS="[hdf5]"
30-
fi
18+
GROUP="test_extra"
19+
EXTRAS="[hdf5]"
20+
elif [[ "${MNE_CI_KIND}" == "minimal" ]]; then
21+
GROUP="test"
22+
EXTRAS=""
23+
STD_ARGS="--progress-bar off ${MNE_QT_BACKEND}"
24+
echo "::group::Upgrading pip installation"
25+
python -m pip install --upgrade pip setuptools
26+
echo "::endgroup::"
3127
elif [[ "${MNE_CI_KIND}" == "old" ]]; then
3228
GROUP="" # group "test" already included when pylock file generated
3329
EXTRAS=""
@@ -39,10 +35,12 @@ elif [[ "${MNE_CI_KIND}" == "old" ]]; then
3935
elif [[ "${MNE_CI_KIND}" == "pip" ]]; then
4036
GROUP="test_extra"
4137
EXTRAS="[full-pyside6]"
38+
python -m pip install --upgrade pip setuptools
4239
else
4340
test "${MNE_CI_KIND}" == "pip-pre"
41+
python -m pip install $STD_ARGS pip setuptools
4442
STD_ARGS="$STD_ARGS --pre"
45-
${SCRIPT_DIR}/install_pre_requirements.sh || exit 1
43+
${SCRIPT_DIR}/install_pre_requirements.sh
4644
GROUP="test_extra"
4745
EXTRAS=""
4846
fi
@@ -61,6 +59,5 @@ else
6159
echo "::group::Installing MNE in development mode using pip"
6260
fi
6361
set -x
64-
python -m pip install $STD_ARGS $INSTALL_ARGS .$EXTRAS $GROUP_ARG
65-
set +x
62+
python -m pip install $STD_ARGS $ONLY_BINARY_ARG $INSTALL_ARGS .$EXTRAS $GROUP_ARG
6663
echo "::endgroup::"

0 commit comments

Comments
 (0)