-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Use Pixi in macOS-intel CI #13704
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Use Pixi in macOS-intel CI #13704
Changes from all commits
37ff4b3
9bf2882
e736f17
07ff86e
7fa7b7d
c26c307
1ff8624
03b2f29
8b73058
962a49e
05359d8
460c24a
5a16daa
dc25bec
d1c45e2
14c0687
0376aae
a207603
4f0770f
e0d0865
7c44343
fe5a459
c2f8a97
de6704c
6e651d8
a46fc3b
0e6aeaf
1ca07e7
79291ff
e246da4
c0e16a2
83c66f5
cb0f159
d798ce9
43f4b96
2422d58
676a845
b56aa5c
ad9df3f
38dd081
f40a537
e1dba77
9f747ae
e10c59a
ca03ac8
bb8e9a7
336495e
649e2b2
a09b734
ab625ba
22ba9eb
279fa65
e08d2cd
25073c6
a3db53d
ad04dec
ed263ed
92e30fa
0cd364a
69d264c
2a645f0
b02265c
019ddf4
f4eab60
c856ffa
4fc7fb6
4a03f47
ea8861d
4025a14
4446fca
d28bda6
a441306
b7ed6ff
803e324
7d20814
93e2dff
8996abd
95a5266
132aa53
1b0b26f
3a031ba
1cfaeb5
b7971c3
105f23a
ca4ba7f
5130043
0cc9aa8
471efe4
2dc89ca
e53eae5
8a352cf
fd1f275
c221707
e70b44d
c8628ba
a0b21d4
814e1d1
5739306
1f9e87d
bd5538e
d805238
181f76b
8bc139b
e5bd471
a62727c
9cd7b0d
a7f21c7
8a00162
179229b
e4dbfc3
cef741d
cbc7847
da2988d
29565b9
949c14f
371fefa
649ef49
dc692c3
d2bc0bc
6dd3350
16c7db7
e87d8cb
1e17ea4
7042a70
777737c
2e7827a
495caf5
4f24eab
1ed6217
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,91 @@ | ||
| # THIS FILE IS AUTO-GENERATED BY tools/write_pixi_toml.py AND WILL BE OVERWRITTEN | ||
|
|
||
| [workspace] | ||
|
drammock marked this conversation as resolved.
|
||
| authors = ["MNE-Python contributors"] | ||
| channels = ["conda-forge"] | ||
| name = "mne" | ||
| platforms = ["osx-64"] | ||
| version = "0.1.0" | ||
|
|
||
| [dependencies] | ||
| antio = ">=0.5.0" | ||
| codespell = "*" | ||
| curryreader = ">=0.1.2" | ||
| darkdetect = "*" | ||
| decorator = ">=5.1" | ||
| defusedxml = "*" | ||
| dipy = ">=1.9" | ||
| edfio = ">=0.4.10" | ||
| eeglabio = "*" | ||
| filelock = ">=3.18.0" | ||
| h5io = ">=0.2.4" | ||
| h5py = ">=2.4" | ||
| imageio = ">=2.6.1" | ||
| imageio-ffmpeg = ">=0.4.1" | ||
| ipyevents = "*" | ||
| ipympl = "*" | ||
| ipython = ">=8.20" | ||
| ipywidgets = "*" | ||
| jinja2 = ">=3.1" | ||
| joblib = ">=0.8" | ||
| jupyter = "*" | ||
| jupyter_client = "*" | ||
| lazy_loader = ">=0.3" | ||
| matplotlib = ">=3.9" | ||
| mffpy = ">=0.11.0" | ||
| nbclient = "*" | ||
| nest-asyncio2 = "*" | ||
| nibabel = ">=5.2" | ||
| nilearn = ">=0.10" | ||
| nitime = ">=0.7" | ||
| numba = ">=0.60" | ||
| numpy = "<3,>=2.0" | ||
| numpydoc = ">=1.6" | ||
| openmeeg = ">=2.5.7" | ||
| packaging = "*" | ||
| pandas = "!=3.0.4,>=2.2" | ||
| pillow = ">=10.2" | ||
| pip = ">=25.1" | ||
| pooch = ">=1.5" | ||
| pre-commit = "*" | ||
| pyarrow = "*" | ||
| pybv = "*" | ||
| pymatreader = "*" | ||
| pyobjc-framework-Cocoa = ">=5.2.0" | ||
| pyside6 = ">=6.11.1" | ||
| pytest = "!=9.1.0,>=8.0" | ||
| pytest-cov = ">=4.1" | ||
| pytest-qt = ">=4.3" | ||
| pytest-rerunfailures = "*" | ||
| pytest-timeout = ">=2.2" | ||
| pytest-xdist = ">=3.6.1" | ||
| python-neo = "*" | ||
| python-picard = ">=0.4" | ||
| pyvista = ">=0.44" | ||
| pyvistaqt = ">=0.11" | ||
| qdarkstyle = "!=3.2.2" | ||
| qtpy = "*" | ||
| rcssmin = ">=1.1" | ||
| refleak = ">=0.2.1" | ||
| ruff = ">=0.1" | ||
| scikit-learn = ">=1.5" | ||
| scipy = ">=1.14" | ||
| sip = "*" | ||
| snirf = "*" | ||
| statsmodels = ">=0.6" | ||
| threadpoolctl = "*" | ||
| tqdm = ">=4.66" | ||
| traitlets = "*" | ||
| trame = "*" | ||
| trame-pyvista = "*" | ||
| trame-vtk = "*" | ||
| trame-vuetify = "!=3.2.3" | ||
| twine = "*" | ||
| vtk = ">=9.2" | ||
| vulture = "*" | ||
| xlrd = "*" | ||
| python = "3.13.*" | ||
|
|
||
| [pypi-dependencies] | ||
| mne-qt-browser = "*" | ||
| pymef = "*" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -61,6 +61,14 @@ elif [[ "$MNE_CI_KIND" == "conda" ]]; then | |
| echo "MNE_LOGGING_LEVEL=warning" | tee -a $GITHUB_ENV | ||
| echo "MNE_TEST_ALLOW_SKIP=.*(on conda|Requires (spm|brainstorm|misc) dataset|CUDA not|Flakey verbose behavior|PySide6 causes segfaults|SCIPY_ARRAY_API).*" | tee -a $GITHUB_ENV | ||
| echo "MNE_QT_BACKEND=PySide6" | tee -a $GITHUB_ENV | ||
| elif [[ "$MNE_CI_KIND" == "pixi" ]]; then | ||
| echo "Setting env vars for $MNE_CI_KIND" | ||
| echo "MNE_LOGGING_LEVEL=warning" | tee -a $GITHUB_ENV | ||
| echo "MNE_QT_BACKEND=PySide6" | tee -a $GITHUB_ENV | ||
| # 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 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would be great to have a |
||
| else | ||
| echo "✕ ERROR: Unrecognized MNE_CI_KIND=${MNE_CI_KIND}" | ||
| exit 1 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,102 @@ | ||
| # Authors: The MNE-Python contributors. | ||
| # License: BSD-3-Clause | ||
| # Copyright the MNE-Python contributors. | ||
|
|
||
| from pathlib import Path | ||
|
|
||
| import tomlkit | ||
| import yaml | ||
| from packaging.requirements import Requirement | ||
|
|
||
|
|
||
| def pip_to_pixi(dependencies_list): | ||
| """Convert pip dependency specifier strings to a pixi-style dict.""" | ||
| out = dict() | ||
| for dep in dependencies_list: | ||
| out[dep.name] = str(dep.specifier) if str(dep.specifier) != "" else "*" | ||
| return out | ||
|
drammock marked this conversation as resolved.
|
||
|
|
||
|
|
||
| pypi_dependencies = sorted(["mne-qt-browser", "pymef"]) | ||
|
|
||
| repo_root = Path(__file__).resolve().parent.parent | ||
| tests_yaml_fpath = repo_root / ".github" / "workflows" / "tests.yml" | ||
| pyproject_fpath = repo_root / "pyproject.toml" | ||
| pyproject = tomlkit.loads(pyproject_fpath.read_bytes()) | ||
| outfile = repo_root / "tools" / "ci" / "macos-intel" / "pixi.toml" | ||
|
|
||
| # handle naming differences between PyPI and conda-forge | ||
| remapping = dict(neo="python-neo") | ||
|
|
||
| # Specify the python version that our pixi job wants | ||
| with open(tests_yaml_fpath) as fid: | ||
| test_yaml = yaml.safe_load(fid) | ||
|
|
||
| foo = test_yaml["jobs"]["pytest"]["strategy"]["matrix"]["include"] | ||
| for job in foo: | ||
| if job["os"] == "macos-15-intel": | ||
| python_version = job["python"] | ||
| # Pixi complains if we don't specify a patch version | ||
| if len(python_version.split(".")) <= 2: | ||
| python_version += ".*" | ||
| break | ||
|
|
||
| # in keys: build-system, dependency-groups, project, tool | ||
| # out keys: workspace, dependencies, pypi-dependencies (may need tasks) | ||
| out = dict() | ||
| workspace = dict( | ||
| authors=["MNE-Python contributors"], | ||
| channels=["conda-forge"], | ||
| name=pyproject["project"]["name"], | ||
| platforms=["osx-64"], | ||
| version="0.1.0", | ||
| ) | ||
| dependencies = pyproject["project"]["dependencies"] | ||
| dependencies.extend(pyproject["dependency-groups"]["dev"]) | ||
| dependencies.extend(pyproject["dependency-groups"]["test"]) | ||
| dependencies.extend(pyproject["dependency-groups"]["test_extra"]) | ||
| dependencies.extend(pyproject["project"]["optional-dependencies"]["hdf5"]) | ||
| dependencies.extend(pyproject["project"]["optional-dependencies"]["full-no-qt"]) | ||
| dependencies.extend(pyproject["project"]["optional-dependencies"]["full-pyside6"]) | ||
| # exclude recursive MNE deps | ||
| dependencies = list( | ||
| filter(lambda x: isinstance(x, str) and "mne[" not in x, dependencies) | ||
| ) | ||
| # strip out platform specifiers; for now this affects only pyobj-framework-cocoa, and | ||
| # since this pixi.toml is destined for macos-intel job, we want it in there so we're | ||
| # skipping writing the logic to parse the platform spec. | ||
| for ix, dep in enumerate(dependencies): | ||
| if (split_ix := dep.find(";")) >= 0: | ||
| dependencies[ix] = dep[:split_ix].strip() | ||
| # handle mismatch between names on PyPI and conda-forge | ||
| dependencies = [remapping.get(dep, dep) for dep in dependencies] | ||
| dependencies.sort() | ||
|
|
||
| # exclude pypi-only deps | ||
| dependencies = [Requirement(dep) for dep in dependencies] | ||
| pypi_dependencies = [Requirement(dep) for dep in pypi_dependencies] | ||
|
|
||
| dependencies = [ | ||
| dep | ||
| for dep in dependencies | ||
| if dep.name not in {pdep.name for pdep in pypi_dependencies} | ||
| ] | ||
|
|
||
| out = { | ||
| "workspace": workspace, | ||
| "dependencies": pip_to_pixi(dependencies), | ||
| "pypi-dependencies": pip_to_pixi(pypi_dependencies), | ||
| } | ||
| out["dependencies"].update(python=python_version) | ||
|
|
||
| doc = tomlkit.document() | ||
| doc.add( | ||
| tomlkit.comment( | ||
| "THIS FILE IS AUTO-GENERATED BY tools/write_pixi_toml.py AND WILL BE OVERWRITTEN" # noqa E501 | ||
| ) | ||
| ) | ||
| doc.update(out) | ||
| # write the file | ||
| outfile.parent.mkdir(parents=True, exist_ok=True) | ||
| with open(outfile, "w") as fid: | ||
| tomlkit.dump(doc, fid, sort_keys=False) | ||
Uh oh!
There was an error while loading. Please reload this page.