Repository navigation
Conversation
|
.. I'm surprised the tests are running given I labelled this [ci doc] |
| depends-on = ["clean-build", "dev-install"] | ||
| description = "Clean and rebuild editable install" | ||
|
|
||
| [tasks.install-test] |
There was a problem hiding this comment.
We should make features for tests + docs.
There was a problem hiding this comment.
Yes we could do it that way, but I'm not sure of the pros and cons. It did not seem there was a way to make conditional install dependencies so I wasn't sure the advantage of having separate feature envs for a developer versus just having one env.
| description = "No-op on non-mac platforms" | ||
|
|
||
| [target.osx-arm64.tasks.prepare-freetype] | ||
| cmd = "cp subprojects/packagefiles/freetype-2.6.1-meson/src/gzip/zconf.h subprojects/freetype-2.6.1/src/gzip" |
There was a problem hiding this comment.
I also don't understand this, is something going wrong with unpacking the subproject? This seems like something we should be fixing in the meson files rather than here?
There was a problem hiding this comment.
I don't think it's a general problem, but it's definitely a problem on macOS with the version of zconf
There was a problem hiding this comment.
OK< I think this was not necessary, as it now works fine without it.
|
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 |
|
I mean add a section like |
|
Ah I see. No that didn't work as I don't think it's compatible with build isolation. |
|
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? |
7d73c47 to
27d86a1
Compare
aedf224 to
055029d
Compare
055029d to
85257fe
Compare
a0a2ff5 to
c0467de
Compare
c0467de to
f3e0de0
Compare
a40ae3f to
3ba6a65
Compare
176bf93 to
d2bad08
Compare
e4bbbd9 to
2538a83
Compare
a31eed4 to
2a4a1a0
Compare
227d5a7 to
349056d
Compare
|
@tacaswell feel free to take over ownership of this. I'm satisfying my own needs by just having a I can still see use in using pixi and lock files to track package dependencies as they change. |
|
I've made some major changes to this PR. We are now able to use the pixi-build machinery to manage the editable install into the pixi environments (the 🦜 helped here). The workflow is now: and pixi takes care of everything! There is a check to make sure we don't accidentally pick up pypi dependencies in them lock file. We probably need to sort out how to implement a monthly job that runs @jklymak sorry for steamrolling you on this! |
|
I have a slight preference to keep pixi config in a separate Also keys like Note: SciPy also maintains a dedicated pixi.toml |
|
I have a strong preference for a |
|
a |
|
As below, I'm definitely no expert, so please don't do what I did a few months ago! My current set up is just to have a pixi.toml in another directory. That works well and including an example pixi.toml here for people to use makes sense to me. If we call it |
…ci doc] Apply suggestions from code review Co-authored-by: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com>
This as a squash of 30-40 commits from about 4 months of on-and-off work. Squashed down to reduce the amount of thrashing in the history. The main highlights: - move all dependencies in the pixi.lock to by conda-only (there is a bug in the pypi <-> CF mapping tables for win-64 + py315, see https://github.com/prefix-dev/parselmouth#100) and add CI to check the pixi.lock is up-to-date and the tests run. - add the pixi-build metadata so that we can both use it internally (it does editable installs by default!) and so that we can add mpl as a conda-source install in other projects. This eliminates the need for a manual build/install step. - add environments for all of the versions of Python that we support (except win-64 + py315 as noted above) - move pixi config -> pixi.toml . The only remaining changes in the pyproject.toml is to sort the dependencies by name. This is a mix of my work, 🦜 assistance, and work with Ruben Arts in person at the scipy 2026 sprints. Assisted-by: opencode:claude-auto Assisted-by: opencode:claude-sonnet-4-5 Assisted-by: opencode:claude-opus-5-5 Co-authored-by: Ruben Arts <ruben.arts@hotmail.com>
065c5e9 to
3ce9522
Compare
|
I do not understand the svg failures that are happening in the pip-based tests (which also seem to be happening on main). I thought I had fixed it by changing the cache key, but the failure came back. I downloaded the failed images and the svgs for multi_font are identical other than the mpl version and date so something is clearly going wrong with the new conversion machinery. |
|
Is it possible the expected svg.pngs are cached? I had that locally. |
|
We briefly talked about the SVG failures in the call yesterday. @QuLogic suspected caching as well. |
Why do we need a template? I haven’t seen the concept of a pixi template anywhere else. In my understanding we just provide a |
|
I think just to differentiate what a developer may want from what we may want for CI runs. But for all I know those are identical. |
|
Yes those are typically identical. And if not, pixi supports multiple environments and tasks so that we can have dedicated parts for CI and local development if needed. |
|
|
||
| .. tab-item:: pixi environment | ||
|
|
||
| A `pixi`_ configuration is included in ``pyproject.toml`` that will |
There was a problem hiding this comment.
| A `pixi`_ configuration is included in ``pyproject.toml`` that will | |
| A `pixi`_ configuration is included in ``pixi.toml`` that will |
| A `pixi`_ configuration is included in ``pyproject.toml`` that will | ||
| install the development dependencies and an editable version of | ||
| Matplotlib (built from your checkout):: |
There was a problem hiding this comment.
| A `pixi`_ configuration is included in ``pyproject.toml`` that will | |
| install the development dependencies and an editable version of | |
| Matplotlib (built from your checkout):: | |
| A `pixi`_ configuration is included in ``pixi.toml`` that provides | |
| a complete development setup. | |
| Optional: Do an explicit install to pre-build the development | |
| environment (if you don't pixi does this as needed): |
|
|
||
| Compiled extensions are rebuilt automatically when you import | ||
| Matplotlib after changing the C++ sources. If you change the build | ||
| configuration (``pyproject.toml``, any ``meson.build`` file) ``pixi run`` |
There was a problem hiding this comment.
| configuration (``pyproject.toml``, any ``meson.build`` file) ``pixi run`` | |
| configuration (``pixi.toml``, any ``meson.build`` file) ``pixi run`` |
| In addition to the default environment, we include a number of specialized | ||
| environments and pinned to older versions of Python. Use | ||
| ``pixi workspace environment list`` to see the full list. For older Pythons | ||
| the environment names have ``3XX` appended. | ||
|
|
||
| default | ||
| Tests and documentation dependencies. | ||
|
|
||
| test | ||
| Tests dependencies only. | ||
|
|
||
| test-extra | ||
| Additional dependencies to reduce the number of skipped tests. | ||
|
|
||
| doc | ||
| The documentation dependencies (but no test dependencies) | ||
|
|
||
| typing | ||
| Dependencies for running various testing. | ||
|
|
||
|
|
||
| For example to run the tests with extra dependencies with Python 3.14 use:: | ||
|
|
||
| pixi run -e test-extra314 test | ||
|
|
||
| .. tip:: | ||
|
|
||
| If you do not want to use ``pixi run`` in front of every command, run:: | ||
|
|
||
| pixi shell [-e ENVIRONMENT] | ||
|
|
||
| which gives the same behavior as ``conda activate``. | ||
|
|
There was a problem hiding this comment.
I'm inclinded to leave this out. Ideally, a developer should not need more than the tasks. And if you are an expert, I think it's bearable that you look for the environments in pixi.toml directly.
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.