[DEV]: add pixi.lock and add pixi to pyproject.toml#31384
Conversation
|
.. I'm surprised the tests are running given I labelled this [ci doc] |
Sorry, something went wrong.
|
It is my understanding that if you have metadata about the build you are (or will soon be able) to point to a repo as a conda dependency and pixi-build will build the conda-package on the fly (the same way it does with pypi-deps). Given that we are going to want That said, I agree we do not want to check in the |
Sorry, something went wrong.
|
I mean add a section like |
Sorry, something went wrong.
|
Ah I see. No that didn't work as I don't think it's compatible with build isolation. |
Sorry, something went wrong.
|
OK< my comment above was incorrect. The new pixi.toml has removed the font copying things, and uses which indeed seems to be fine. Still not sure if we should run with features or just a separate install steps? |
Sorry, something went wrong.
7d73c47 to
27d86a1
Compare
March 28, 2026 04:49
aedf224 to
055029d
Compare
March 28, 2026 16:22
055029d to
85257fe
Compare
March 28, 2026 16:32
a0a2ff5 to
c0467de
Compare
March 30, 2026 17:51
c0467de to
f3e0de0
Compare
March 30, 2026 18:09
a40ae3f to
3ba6a65
Compare
April 1, 2026 14:27
3ba6a65 to
313bf08
Compare
April 1, 2026 14:28
|
Note: Mypy errors are based on a new mypy release yesterday, which improves type narrowing. https://mypy.readthedocs.io/en/stable/changelog.html Unrelated to here, but needs investigation. |
Sorry, something went wrong.
|
Built docs are here: https://output.circle-artifacts.com/output/job/2a1cb0cd-b9e6-487d-8213-ccadbf52b0b5/artifacts/0/doc/build/html/devel/development_setup.html Not sure about the Note... Tip... Note... I think I'll move the pyproject.toml note up to be a warning as we really don't want people to edit that unless absolutely necessary. EDIT: combined the two tips, and made the note about pyproject.toml a warning. |
Sorry, something went wrong.
7b7c719 to
0ce998c
Compare
April 1, 2026 15:51
|
Do we need the warning at all? / Do we need the warning here? This is about dev environment setup. Somebody setting up is not likely to mess with existing configuration. We also don’t warn on the other environment setups. |
Sorry, something went wrong.
I guess I'm not sure, partially out of ignorance for how others work. The central tension here is between what a casual developer wants, which is a pixi.toml that they may want to edit, versus what we want for CI which is to check and create the canonical If someone can't get However, I'm very open to the idea that the way I've suggested we resolve this tension here is not the best one. You could imagine the CI-verified pixi.lock goes somewhere more discrete than the top level, and the burden to update it belongs to experienced developers who change the project requirements. That would be a bit of reorganization here, but may be cleaner. |
Sorry, something went wrong.
|
My primary question would be: Isn’t the config we provide here good enough for the average developer? There could be expert use cases, but I’d trust that experts know enough to not mess up. I would only discuss a custom pixi.toml if that is a typical use case: And then its usage should be explicitly explained somewhere around here. Also, we have the PR review, so that we will catch improper updates. Overall, I’d leave this out and only add the warning, if improper updates become reasonably common. |
Sorry, something went wrong.
|
Note: I did a pixi setup yesterday on a fresh machine, and it went quite smooth with the preconfigured settings. Running tests is possible. Doc build is a bit fiddly because Sphinx crashes with awkward messages if the “external” dependencies Ghostscript and Latex are not available. That’s not a direct issue of pixi, but we could consider including the Ghostscript conda package (in a follow up PR). |
Sorry, something went wrong.
I think so, and it's encouraging that it works on at least three machines (mine, yours, and CI) The goal with the warning was just to alert folks not to edit pyproject.toml. However, happy to remove that section and add it back if it becomes problematic. |
Sorry, something went wrong.
965359f to
24087b2
Compare
April 1, 2026 19:38
timhoffm
left a comment
There was a problem hiding this comment.
Optional wording improvements.
Sorry, something went wrong.
24087b2 to
63bbd36
Compare
April 2, 2026 00:40
…ci doc] Apply suggestions from code review Co-authored-by: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com>
63bbd36 to
093c210
Compare
April 2, 2026 19:24
|
@tacaswell what do you think is missing to get this in as a minimal starting point? I'd like to experiment with this in regular usage, and for that it'd be nice to have the config on main. |
Sorry, something went wrong.
|
Anyone else have comments on this? @tacaswell or @QuLogic ? I needed to install something and realized I can't actually use this until its merged ;-) |
Sorry, something went wrong.
|
Sorry, something went wrong.
|
The lock check failing may be a v6 vs v7 thing on the lock file (which is coupled to pixi 0.68). |
Sorry, something went wrong.
|
I'm more than happy for someone else to take this over or redo it. I maintain a willful ignorance of the packaging ecosystem. Conversely, it'd be nice to have something that works. |
Sorry, something went wrong.
That’s strange. I thought conda-forge is given precedence, and the environment.yml in our project root shows that most of the dev environment can be built on conda. Anyway, we might want to use a pixi.toml for configuration and better separation. Inspiration could be taken from scipy, who have a fairly comprehensive setup. |
Sorry, something went wrong.
Edit: apologies for the CI churn --- I needed to iterate on the Pixi workflow to get it working end-to-end.
Overview
This PR adds Pixi configuration to
pyproject.tomland introduces a committedpixi.lock.The main goal is to provide a project-committed, pinned dependency snapshot for Matplotlib, addressing #23548. In particular:
pyproject.tomldefines the Pixi environment under[tool.pixi]pixi.lockrecords the fully resolved dependency setWhy
pyproject.tomlPixi configuration is placed in
pyproject.tomlrather than a project-levelpixi.toml.The reasoning is:
pyproject.tomlis already the canonical project configurationpixi.toml, which Pixi will prefer overpyproject.tomlThis gives the project a canonical shared configuration while still allowing personal overrides.
Lockfile policy
A main goal of this PR is to commit a pinned dependency list, and
pixi.lockis the mechanism used for that.pixi.lockshould therefore be treated as part of the repository state:pixi.lockIn that sense,
pixi.lockis the committed pinned dependency snapshot for the project.Developer workflow
Basic usage:
After that, for example:
Dependency changes:
If dependencies change, then
pixi.lockshould be regenerated. It is ignored by default in.gitignoreso developers who want to changepixi.lockwill need to regenerate it, and force add it to a commit:tools/pixi.example.tomlA template is provided for developers who want to customize their local Pixi setup.
For example:
This is intended for local experimentation or system-specific tuning. It is not the project's canonical Pixi configuration.
Key design decisions
Editable install is not managed directly by Pixi
This PR intentionally does not use:
In testing, that led to lockfile instability (
lock-file not up-to-date with the workspace), especially in CI.Instead, responsibilities are split:
pip install -e .installs Matplotlib itselfThis keeps
pixi.lockstable while still supporting editable development installs.Single environment
Although Pixi supports separate environments such as
testanddoc, this PR currently uses a single environment containing the relevant dependencies.The main reason is developer convenience:
This can be revisited later if stricter separation is desirable.
CI
This PR adds a minimal CI job that checks that the Pixi environment can be recreated from the committed lockfile.
At the moment the job is intentionally lightweight: it verifies that the lockfile works and that Matplotlib can be built/imported in that environment. It can be extended later to run tests and/or documentation builds.
Notes / future work
pixi.tomloverrides
AI disclosure
I went back and forth w/ chatGPT quite a bot on how to organize this and the various tradeoffs. It also helped with writing this summary, which is of course long-winded, but hopefully complete.