-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Migrate development workflow to Pixi #10888
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?
Conversation
- Using the bare-minimum.yml requirements file to act as a starting point to build the composable environments - Add pixi.lock to gitignore (no need to commit lock files in library repos) - Update .gitattributes (automatically done by pixi) - Configure xarray as source dependency with dynamic versioning
… files Already ported to pixi
Already migrated to pixi
Update requirements files to remove deps handled by Pixi
Handled by pixi
Handled by pixi
Handled by pixi
Handled by pixi
Handled by pixi
Handled by pixi
Handled by pixi
Handled by pixi
Handled by pixi
Handled by pixi
Handled by pixi
Handled by pixi
|
OK - all CI that needed to be migrated is working with the new Pixi setup (including nightlies). See https://github.com/VeckoTheGecko/xarray/tree/test-pixi-dust for the nightlies and pyright workflows (that branch just has an extra commit that enables the workflows for my fork) I think this is ready for a full review cc @shoyer |
|
re. #10888 (comment), it looks like dask is pinned to be 2025.11.0 in the |
|
Claude solved this by adding This must be a uv thing? The tight pin on dask has been around for years. |
|
Hmm.. does that apply globally so every env tests against dask main when dask is requested? |
No, only to the environments which have the |
Co-authored-by: Deepak Cherian <[email protected]>
5eca834 to
c1f0bd1
Compare
This comment was marked as outdated.
This comment was marked as outdated.
|
that doesn't sound right, we have been monkeypatching Instead, I believe the reason is that this particular environment does not contain |
Thanks, didn't see those. I just noticed a bunch of tests in nightly are skipped, though I'm not sure if that's a regression since I don't have prior logs to compare with. The env now has got less deps than before (before - the base environment file was taken, packages were deleted and added using a bash script). Are there any more dependencies that would be good for that env? Grepping through the test suite for which might be of interest |
keewis
left a comment
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.
the nightly env used to have a few more dependencies, and I think we should try to keep it that way: what we're testing is how certain nightly versions interact with the entire library.
|
|
||
| # other | ||
| cftime = "*" | ||
| pint = "*" |
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.
move to the array section?
| ] | ||
|
|
||
| [feature.nightly.dependencies] | ||
| python = "*" |
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.
might be worth pinning this to 3.13?
|
|
||
| [feature.nightly.dependencies] | ||
| python = "*" | ||
|
|
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.
should we add iris, cartopy, and seaborn, as well, here?
(posting now for visibility and to request feedback/pixi debugging help)
Overview
Fixes #10732
This PR migrates the dev workflow and CI for Xarray across to Pixi, providing the following benefits:
See the original issue for more info.
Changes so far in this PR:
pixi.tomlsplit apart into features that I thought were sensible . I left outenvironment-benchmarks.yml,binder/environmentas that has interactions with asv, and Binder - this PR is already big enough, and I think those should be explored another time.cache-pixi-lock.ymlworkflow (see below section "Considerations")ci.yaml98% there - for some reason the CI of Pixi is findingwhich pytestto be.pixi/envs/default/Scripts/pytestwhile localpixi run -e test-all-deps-py313 which pytestis finding.pixi/envs/test-all-deps-py313/bin/pytest(seetest-pixi-dustbranch, example action run) . Any ideas why @lucascolley ?I've tried to make the commits tidy to help with reviewing commit by commit, which might be easier. I also was quite diligent when migrating from the old env files to make sure versions were the same.
Testing instructions
Resources: Pixi Scipy 2025 talk | Docs: Manifest Reference
pixi info-> show info about the pixi environmentspixi run docpixi run testthen choose the environment you want to run the tests in (orpixi run -e environment_name test)test-all-deps-py313environment (corresponding to the old environmentci/requirements/environment.yml)pixi run pre-commitpixi run typingEnter an environment (equivalent to
conda activate):pixi shell -e env_nameExit an environment (equivalent to
conda activate):exitor Ctrl+DSee all tasks:
pixi runConsiderations
Lock files o' lock files
There was some interesting conversation in #10732 (comment) about lock files. To summarise:
We have two choices to handle the lock files, either (a) generate them in CI, or (b) commit them to the repo and periodically update them.
(a) generating in CI (done in this PR):
pixi.lockto.gitignoredate + hash(pixi.toml)pixi.lockfile for environment creationPros:
cache-pixi-lock.ymlis re-usable across different projects).Cons:
pixi.lockand what's in CI. Local developers need to periodically deletepixi.lockand regenerate it.(b) commit the lock files
(I think this is the gist of it)
bleeding-edgewhich runs every few days by taking the current lockfile, running an update, and then running tests. Any failures can be automatically reported in an issuepixi.tomlmanifest and talk with upstream to see whats upPros:
Cons:
@lucascolley knows the full extent as he's been exploring this setup at Scipy
Conclusion
Approach (a) has minimal setup/maintenance with little downside. I think that it's a good solution for smaller projects in particular (we've adopted it at Parcels - cc @maxrjones might be interesting based on your comment )
Approach (b) is more robust if having the same environment between all devs is highly valued (@shoyer mentioned during a dev meeting that this would be good for xarray), but requires more setup.
I recommend we go for (a) as is done in this PR, and consider (b) separately .
@lucascolley would it be beneficial to do a write-up of all this on
prefix.devsometime to help guide others dealing with this? I'm happy to write or collab on a blog post.Feedback wanted: To what extent do we promote Conda dev workflows
Yeah - I don't know. In the projects I'm working on I've gone full Pixi, but those are smaller projects.
I've deleted the old environment files to avoid duplication, but can re-add them to the extent which you want to support conda dev workflows.
I've held off on updating the contributing instructions for this reason.
EDIT: Joined the dev meeting - @keewis doesn't think its a bad idea to fully migrate dev instructions from conda to Pixi. Later (if people really want conda instructions) we can show how to use pixi to export a conda compatible env file - no need for us to maintain two separate env files.
I think that's about it! I don't think I've forgotten anything, but it is late on a Friday so maybe - will update if that's the case :)
Let me know if you want me to drop by the dev meeting on 5 Nov - but I'm happy to keep this async otherwise.
(🎉 for my first significant contribution to Xarray!!!)