-
-
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
Draft
scott-huberty
wants to merge
114
commits into
mne-tools:main
Choose a base branch
from
scott-huberty:pixi
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Use Pixi in macOS-intel CI #13704
Changes from all commits
Commits
Show all changes
114 commits
Select commit
Hold shift + click to select a range
37ff4b3
WIP: Add pixi CI runner
scott-huberty 9bf2882
FIX: syntax
scott-huberty e736f17
TST: test branch
scott-huberty 07ff86e
FIX: skip cache for now
scott-huberty 7fa7b7d
FIX: create pixi.toml
scott-huberty c26c307
check
scott-huberty 1ff8624
try
scott-huberty 03b2f29
dont install
scott-huberty 8b73058
try again
scott-huberty 962a49e
activate environment
scott-huberty 05359d8
FIX: rm cruft
scott-huberty 460c24a
debug
scott-huberty 5a16daa
arg
scott-huberty dc25bec
more debug
scott-huberty d1c45e2
tests
scott-huberty 14c0687
more
scott-huberty 0376aae
try
scott-huberty a207603
hack: prepend path with executable
scott-huberty 4f0770f
FIX: wrong var
scott-huberty e0d0865
FIX: shell
scott-huberty 7c44343
Found the issue (login shell). Now try to remove previous hack
scott-huberty fe5a459
now debug failiing conda-ish CI's
scott-huberty c2f8a97
arggh GH YAML syntax doesnt allow double quotes
scott-huberty de6704c
try using shell wrapper
scott-huberty 6e651d8
more
scott-huberty a46fc3b
remove branch
scott-huberty 0e6aeaf
restore login shell
scott-huberty 1ca07e7
specify manifest path
scott-huberty 79291ff
do install
scott-huberty e246da4
revert tmp conda tweaks
scott-huberty c0e16a2
revert pixi toml creation
scott-huberty 83c66f5
remove cruft
scott-huberty cb0f159
remove micromamba shell [skip actions] [skip az[] [ci skip]
scott-huberty d798ce9
checkpoint before rebase
scott-huberty 43f4b96
Merge remote-tracking branch 'upstream/main' into pixi2
scott-huberty 2422d58
add lock file
scott-huberty 676a845
for debugging
scott-huberty b56aa5c
FIX: filename
scott-huberty ad9df3f
FIX: try toml
scott-huberty 38dd081
guard
scott-huberty f40a537
cruft
scott-huberty e1dba77
temp debugging statements
scott-huberty 9f747ae
triage
scott-huberty e10c59a
debug
scott-huberty ca03ac8
TMP: triage python/pytest command
scott-huberty bb8e9a7
Revert "TMP: triage python/pytest command"
scott-huberty 336495e
reveal PATH
scott-huberty 649e2b2
fix: cruft
scott-huberty a09b734
foo
scott-huberty ab625ba
bar
scott-huberty 22ba9eb
baz
scott-huberty 279fa65
shell-hook
scott-huberty e08d2cd
persist across steps?
scott-huberty 25073c6
pipe
scott-huberty a3db53d
wrapper
scott-huberty ad04dec
oops.. typo
scott-huberty ed263ed
just use erics line of code and also run gh_actions_deps
scott-huberty 92e30fa
Pixi run prefix
scott-huberty 0cd364a
FIX: syntax
scott-huberty 69d264c
try storing value without quotes
scott-huberty 2a645f0
Merge remote-tracking branch 'upstream/main' into pixi2
scott-huberty b02265c
activate environment false
scott-huberty 019ddf4
FIX: syntax
scott-huberty f4eab60
activate environment
scott-huberty c856ffa
Fixes for Pixi
scott-huberty 4fc7fb6
WIP: Try solving gen lock file from Pyprojec.toml
scott-huberty 4a03f47
Revert "WIP: Try solving gen lock file from Pyprojec.toml"
scott-huberty ea8861d
WIP pixi from pyproj [ci skip]
drammock 4025a14
Remove PREFIX strategy
scott-huberty 4446fca
work around for macOS login shells
scott-huberty d28bda6
[autofix.ci] apply automated fixes
autofix-ci[bot] a441306
FIX: do prepend path hack AFTER pixi setup
scott-huberty b7ed6ff
Merge remote-tracking branch 'origin/pixi' into pixi
scott-huberty 803e324
move/rename manifest and lockfile
drammock 7d20814
visibility [skip circle] [skip azp]
scott-huberty 93e2dff
Merge remote-tracking branch 'origin/pixi' into pixi
scott-huberty 8996abd
FIX: path
scott-huberty 95a5266
FIX: guard [skip circle] [skip azp]
scott-huberty 132aa53
Merge remote-tracking branch 'upstream/main' into pixi [skip circle] …
scott-huberty 1b0b26f
restore pixi [skip circle] [skip azp]
scott-huberty 3a031ba
add pixi to verify python [skip circle] [skip azp]
scott-huberty 1cfaeb5
pixi path [skip circle] [skip azp]
scott-huberty b7971c3
fix syntax [skip circle] [skip azp]
scott-huberty 105f23a
doh [skip circle] [skip azp]
scott-huberty ca4ba7f
udpate lockfile to match want python
scott-huberty 5130043
skip [skip azp] [skip circle]
scott-huberty 0cc9aa8
handle pypi deps
scott-huberty 471efe4
[autofix.ci] apply automated fixes
autofix-ci[bot] 2dc89ca
convert pip-style specifiers to dict
drammock e53eae5
write to correct file loc
drammock 8a352cf
fix pypi/cf name mismatch; comments
drammock fd1f275
regen toml and lock files
drammock c221707
add macos-intel pixi ci lockfile update to spec-zero workflow
drammock e70b44d
update lockfile (again)
drammock c8628ba
bump py
drammock a0b21d4
skip gh_actions_deps.sh for pixi
drammock 814e1d1
[skip circle][skip azp] specify python version
scott-huberty 5739306
Merge branch 'main' into pixi
scott-huberty 1f9e87d
update pixi toml/lock
scott-huberty bd5538e
[circle skip][skip azp] need pyside6
scott-huberty d805238
Dont set MNE_TEST_ALLOW_SKIP in Pixi job
scott-huberty 181f76b
merge
scott-huberty 8bc139b
regen pixi toml/lock
scott-huberty e5bd471
comment
scott-huberty a62727c
[autofix.ci] apply automated fixes
autofix-ci[bot] 9cd7b0d
ping
scott-huberty a7f21c7
Merge branch 'pixi' of github.com:scott-huberty/mne-python into pixi
scott-huberty 8a00162
ping
scott-huberty 179229b
Merge remote-tracking branch 'upstream/main' into pixi
scott-huberty e4dbfc3
Apply suggestion from @drammock
drammock cef741d
try...
scott-huberty cbc7847
flag
scott-huberty da2988d
fix
scott-huberty 29565b9
fix
scott-huberty File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| # 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 = ">=0.8" | ||
| 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" | ||
| mne-qt-browser = "*" | ||
| nbclient = "*" | ||
| nest-asyncio2 = "*" | ||
| nibabel = ">=2.0" | ||
| nilearn = "*" | ||
| nitime = ">=0.7" | ||
| numba = ">=0.35" | ||
| numpy = ">=2.0,<3" | ||
| numpydoc = ">=1.6" | ||
| openmeeg = ">=2.5.7" | ||
| packaging = "*" | ||
| pandas = ">=2.2,!=3.0.4" | ||
| 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 = ">=8.0,!=9.1.0" | ||
| pytest-cov = ">=4.1" | ||
| pytest-qt = ">=4.3" | ||
| pytest-rerunfailures = "*" | ||
| pytest-timeout = ">=2.2" | ||
| pytest-xdist = ">=3.6.1" | ||
| python = "3.13.*" | ||
| 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 = "*" | ||
| typing-extensions = ">=4.15" | ||
| vtk = ">=9.2" | ||
| vulture = "*" | ||
| xlrd = "*" | ||
|
|
||
| [pypi-dependencies] | ||
| pymef = "*" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,99 @@ | ||
| # Authors: The MNE-Python contributors. | ||
| # License: BSD-3-Clause | ||
| # Copyright the MNE-Python contributors. | ||
|
|
||
| from pathlib import Path | ||
|
|
||
| import tomlkit | ||
| import yaml | ||
|
|
||
|
|
||
| def pip_to_pixi(dependencies_list): | ||
| """Convert pip dependency specifier strings to a pixi-style dict.""" | ||
| out = dict() | ||
| for dep in dependencies_list: | ||
| if " " in dep: | ||
| name, version = dep.split(" ", maxsplit=1) | ||
| else: | ||
| name, version = dep, "*" | ||
| out[name] = "".join(version.split(" ")) # pixi hates internal spaces | ||
| return out | ||
|
drammock marked this conversation as resolved.
|
||
|
|
||
|
|
||
| pypi_dependencies = ["pymef"] # "nest-asyncio2", "pyobjc-framework-Cocoa"] | ||
|
|
||
| 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] | ||
|
|
||
| # Add Python Version | ||
| dependencies.append(f"python {python_version}") | ||
|
|
||
| # exclude pypi-only deps | ||
| dependencies = sorted(set(dependencies) - set(pypi_dependencies)) | ||
|
|
||
| out = { | ||
| "workspace": workspace, | ||
| "dependencies": pip_to_pixi(dependencies), | ||
| "pypi-dependencies": pip_to_pixi(pypi_dependencies), | ||
| } | ||
|
|
||
| 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) | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this PR the steps are:
spec_zero_update_versions.py(which may changepyproject.toml)tools/sync_dependencies.py(updates README)tools/hooks/update_environment_file.pyI'm wondering if we should instead:
@scott-huberty @larsoner @tsbinns WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There could be the case where
tools/sync_dependencies.pycreates a diff independently fromspec_zero_update_versions.pyif a change was made in a PR to a dep specifier inpyproject.toml, but the README wasn't updated at the same time.Currently, the missing update of the README would get caught and fixed the next time the SPEC0 action gets run, but the suggested change would gate this behind
spec_zero_update_versions.pyintroducing some changes.This could lead to deps listed in README being out-of-date for several weeks/months, which was what we tried to resolve in #13832 by adding the README syncing to the SPEC0 action.
Maybe it is safer therefore to only gate step 3 on whether it is dirty?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok right, thanks for the reminder. so we do want step 2 to always run. And it seems like the same logic could also apply to step 3? E.g., someone changes a minimum pin manually in a PR but then
spec_zero_update_versions.pyhappens not to bump anything, thenpyproject.tomlwouldn't show up asdirtywhen this action runs (but we'd still want to update the old CI pins). This makes me think that we should not even gate steps 5-7 either; they should all just run and we should only use thedirtycheck to decide whether the action needs to make a commit.notes:
environment.ymldoesn't risk getting out of sync the same way that the README does... but I'd actually lean toward removing theenvironment.ymlupdater from pre-commit, and standardizing our procedure as "all of the trickle-down effects of dep/pin changes inpyproject.tomlhappen at the same time (weekly cron job)" instead of some-but-not-all being part of our pre-commit checks.pyproject.tomlanymore, it should just be:git diff --quiet HEADThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, all tests are passing!
So we should we remove the
dirtygate from the install pixi / updatepixi.tomlsteps (steps 5-6)?