Skip to content

Use Pixi in macOS-intel CI - #13704

Merged
larsoner merged 133 commits into
mne-tools:mainfrom
scott-huberty:pixi
Sep 23, 2026
Merged

larsoner merged 133 commits into
mne-tools:mainfrom
scott-huberty:pixi

Conversation

@scott-huberty

Copy link
Copy Markdown
Contributor

I'm exploring the feasibility of using Pixi to resolve the virtual environment and run tests specifically for the MacOS Intel CI, which currently uses Mamba to create the virtual environment.

My initial strategy was to just to do pixi init --import environment.yml, so that we can leverage our already defined YAML config file to pull in all the necessary dependencies, as well as configuring prefix-dev/setup-pixi to automatically activate our virtual environment, so that we can run commands like pytest etc without having to prepend pixi run everywhere for the pixi CI...

Unfortunately the only way I could get this to work was to disable use of a login shell.. Which of course makes all the condo-like CI's fail!!

@scott-huberty
scott-huberty marked this pull request as draft February 28, 2026 00:28
@tsbinns

tsbinns commented Feb 28, 2026

Copy link
Copy Markdown
Member

Hey @scott-huberty, looking at the current diff I noticed you're setting up pixi without activating the env, initing with environment.yml, then setting up again with env activation.

Found when switching to uv for the old job that the env can be activated at setup with a given Python ver and then have the required packages installed in github_actions_dependencies.sh:

- uses: astral-sh/setup-uv@v7
with:
version: ">=0.9"
activate-environment: true
cache-dependency-glob: |
**/pylock.ci-old.toml
python-version: ${{ matrix.python }}
if: matrix.kind == 'old'
- run: bash ./tools/github_actions_dependencies.sh

Wondered if a similar thing could work for pixi rather than needing 2 setups. Haven't looked through diffs for all commits, so apologies if you tried this already.

@scott-huberty
scott-huberty marked this pull request as ready for review August 12, 2026 22:11
Comment thread tools/write-pixi-toml.py Resolved
@scott-huberty

Copy link
Copy Markdown
Contributor Author

OK @drammock - I think this is ready! FYI commits 16c7db7 and onward were added after our pair programming session yesterday.

@larsoner larsoner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one tiny comment/idea from me!

@drammock let me know if you want to look again or if you're okay with me merging once my comment is addressed. If you pair-programmed you might already approve...

# Our cache_dir test has problems when the path is too long, so prevent it from getting too long
if [[ "$RUNNER_OS" == "macOS" ]]; then
echo "PYTEST_DEBUG_TEMPROOT=/tmp" | tee -a $GITHUB_ENV
fi

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be great to have a MNE_TEST_ALLOW_SKIP in this branch to ensure only the examples you expect to be skipped are actually skipped. The old macOS job had this above ☝️ . You could try taking it directly, but maybe better to cross-reference it against the actual skips. (It might suggest and additional dependency or two that you could add to shrink the skip list.)

@drammock

Copy link
Copy Markdown
Member

Just one tiny comment/idea from me!

@drammock let me know if you want to look again or if you're okay with me merging once my comment is addressed. If you pair-programmed you might already approve...

+1 for merge if @larsoner is happy and the CI is green.

Add environment variable for MNE test skipping conditions.
@larsoner
larsoner enabled auto-merge (squash) September 23, 2026 18:12
@larsoner

larsoner commented Sep 23, 2026 •

Copy link
Copy Markdown
Member
  1. Update refleak to 0.2.2, should fix one failure
  2. Get it to use accelerate as the linalg backend
  3. Fix these skips:
UNEXPECTED SKIP [1] mne/stats/tests/test_cluster_equiv.py:19: could not import 'formulaic': No module named 'formulaic'
UNEXPECTED SKIP [1] mne/stats/tests/test_cluster_level_modern.py:23: could not import 'formulaic': No module named 'formulaic'
UNEXPECTED SKIP [1] tools/ci/macos-intel/.pixi/envs/default/lib/python3.13/site-packages/_pytest/doctest.py:551: unable to import module PosixPath('/Users/runner/work/mne-python/mne-python/mne/viz/backends/_lite.py')

All of these look like new missing dependencies.

@scott-huberty

Copy link
Copy Markdown
Contributor Author
  1. Update refleak to 0.2.2, should fix one failure
  2. Get it to use accelerate as the linalg backend
  3. Fix these skips:
UNEXPECTED SKIP [1] mne/stats/tests/test_cluster_equiv.py:19: could not import 'formulaic': No module named 'formulaic'
UNEXPECTED SKIP [1] mne/stats/tests/test_cluster_level_modern.py:23: could not import 'formulaic': No module named 'formulaic'
UNEXPECTED SKIP [1] tools/ci/macos-intel/.pixi/envs/default/lib/python3.13/site-packages/_pytest/doctest.py:551: unable to import module PosixPath('/Users/runner/work/mne-python/mne-python/mne/viz/backends/_lite.py')

All of these look like new missing dependencies.

Hopefully 80486f5 takes care of it.

@larsoner

Copy link
Copy Markdown
Member

hed, sphinx-gallery, and mne_bids missing?

ERROR mne/tests/test_annotations.py::test_hed_annotations - /Users/runner/work/mne-python/mne-python/mne/tests/test_annotations.py:2069: UNEXPECTED SKIP: "could not import 'hed': No module named 'hed'"
ERROR mne/tests/test_annotations.py::test_hed_annotations_mixed_concatenation - /Users/runner/work/mne-python/mne-python/mne/tests/test_annotations.py:2230: UNEXPECTED SKIP: "could not import 'hed': No module named 'hed'"
ERROR mne/tests/test_annotations.py::test_hed_annotations_to_data_frame - /Users/runner/work/mne-python/mne-python/mne/tests/test_annotations.py:2327: UNEXPECTED SKIP: "could not import 'hed': No module named 'hed'"
ERROR mne/tests/test_epochs.py::test_split_naming[epochs_to_split0-bids] - /Users/runner/work/mne-python/mne-python/mne/tests/test_epochs.py:1722: UNEXPECTED SKIP: "could not import 'mne_bids': No module named 'mne_bids'"
ERROR mne/io/fiff/tests/test_raw_fiff.py::test_bids_split_files - /Users/runner/work/mne-python/mne-python/mne/io/fiff/tests/test_raw_fiff.py:710: UNEXPECTED SKIP: "could not import 'mne_bids': No module named 'mne_bids'"
ERROR mne/viz/_brain/tests/test_brain.py::test_brain_scraper[pyvistaqt] - /Users/runner/work/mne-python/mne-python/mne/viz/_brain/tests/test_brain.py:2078: UNEXPECTED SKIP: "could not import 'sphinx_gallery': No module named 'sphinx_gallery'"

@scott-huberty

Copy link
Copy Markdown
Contributor Author

hed, sphinx-gallery, and mne_bids missing?

ERROR mne/tests/test_annotations.py::test_hed_annotations - /Users/runner/work/mne-python/mne-python/mne/tests/test_annotations.py:2069: UNEXPECTED SKIP: "could not import 'hed': No module named 'hed'"
ERROR mne/tests/test_annotations.py::test_hed_annotations_mixed_concatenation - /Users/runner/work/mne-python/mne-python/mne/tests/test_annotations.py:2230: UNEXPECTED SKIP: "could not import 'hed': No module named 'hed'"
ERROR mne/tests/test_annotations.py::test_hed_annotations_to_data_frame - /Users/runner/work/mne-python/mne-python/mne/tests/test_annotations.py:2327: UNEXPECTED SKIP: "could not import 'hed': No module named 'hed'"
ERROR mne/tests/test_epochs.py::test_split_naming[epochs_to_split0-bids] - /Users/runner/work/mne-python/mne-python/mne/tests/test_epochs.py:1722: UNEXPECTED SKIP: "could not import 'mne_bids': No module named 'mne_bids'"
ERROR mne/io/fiff/tests/test_raw_fiff.py::test_bids_split_files - /Users/runner/work/mne-python/mne-python/mne/io/fiff/tests/test_raw_fiff.py:710: UNEXPECTED SKIP: "could not import 'mne_bids': No module named 'mne_bids'"
ERROR mne/viz/_brain/tests/test_brain.py::test_brain_scraper[pyvistaqt] - /Users/runner/work/mne-python/mne-python/mne/viz/_brain/tests/test_brain.py:2078: UNEXPECTED SKIP: "could not import 'sphinx_gallery': No module named 'sphinx_gallery'"

I think we needed to include the free threaded build dep group added in #13323 ?

@larsoner
larsoner merged commit f6b19ee into mne-tools:main Sep 23, 2026
25 checks passed
@larsoner

Copy link
Copy Markdown
Member

Yes must have been it! 😄

@scott-huberty
scott-huberty deleted the pixi branch September 23, 2026 22:03
@scott-huberty

Copy link
Copy Markdown
Contributor Author

dang that took a lot longer than I thought. Thx all!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants