Title: [DEV]: add pixi.lock and add pixi to pyproject.toml by jklymak · Pull Request #31384 · matplotlib/matplotlib · GitHub
Open Graph Title: [DEV]: add pixi.lock and add pixi to pyproject.toml by jklymak · Pull Request #31384 · matplotlib/matplotlib
X Title: [DEV]: add pixi.lock and add pixi to pyproject.toml by jklymak · Pull Request #31384 · matplotlib/matplotlib
Description: 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.toml and introduces a committed pixi.lock. The main goal is to provide a project-committed, pinned dependency snapshot for Matplotlib, addressing #23548. In particular: pyproject.toml defines the Pixi environment under [tool.pixi] pixi.lock records the fully resolved dependency set CI exercises that lockfile to verify that it can be used reproducibly Why pyproject.toml Pixi configuration is placed in pyproject.toml rather than a project-level pixi.toml. The reasoning is: pyproject.toml is already the canonical project configuration it keeps the shared Pixi definition attached to the project itself developers who want local customization can still create an untracked pixi.toml, which Pixi will prefer over pyproject.toml This 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.lock is the mechanism used for that. pixi.lock should therefore be treated as part of the repository state: changes to Pixi dependency inputs should be accompanied by a regenerated pixi.lock CI uses the lockfile to verify reproducibility old commits retain the dependency snapshot that was current at that point in history In that sense, pixi.lock is the committed pinned dependency snapshot for the project. Developer workflow Basic usage: pixi install pixi run python -m pip install \ --no-build-isolation \ --config-settings=setup-args="-Db_lto=false" \ --editable . After that, for example: pixi run tests-core pixi run build-doc Dependency changes: If dependencies change, then pixi.lock should be regenerated. It is ignored by default in .gitignore so developers who want to change pixi.lock will need to regenerate it, and force add it to a commit: mv pixi.toml pixi.backup pixi lock git add -f pixi.lock tools/pixi.example.toml A template is provided for developers who want to customize their local Pixi setup. For example: cp tools/pixi.example.toml pixi.toml 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: [pypi-dependencies] matplotlib = { path = ".", editable = true } In testing, that led to lockfile instability (lock-file not up-to-date with the workspace), especially in CI. Instead, responsibilities are split: Pixi manages the environment and pinned dependencies pip install -e . installs Matplotlib itself This keeps pixi.lock stable while still supporting editable development installs. Single environment Although Pixi supports separate environments such as test and doc, this PR currently uses a single environment containing the relevant dependencies. The main reason is developer convenience: avoids repeated editable installs in separate environments keeps the workflow simple still allows the lockfile to capture the relevant dependency sets 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 extend Pixi CI coverage to run more tests and build docs decide whether additional environment separation is worthwhile refine developer-facing documentation around local pixi.toml overrides 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.
Open Graph Description: 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.toml and introduces a committed pix...
X Description: 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.toml and introduces a committed pix...
Opengraph URL: https://github.com/matplotlib/matplotlib/pull/31384
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:7d737531-be64-4489-f2c1-252ec678dcf7 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 90CE:1D5468:27CA3A9:34EE4B7:6A52149E |
| html-safe-nonce | e879ab16ced029283c2ea69120a3304e6e357d2f9e707100ddc20b0bd7974de9 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MENFOjFENTQ2ODoyN0NBM0E5OjM0RUU0Qjc6NkE1MjE0OUUiLCJ2aXNpdG9yX2lkIjoiMjQ5MDMwNzY2MDE3NzYwOTg4NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 2520a02e1dfdafbaf0f1ff5ecac2b891350996b73423b3ea049bc06e6457af32 |
| hovercard-subject-tag | pull_request:3447333643 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/matplotlib/matplotlib/pull/31384/files |
| twitter:image | https://avatars.githubusercontent.com/u/1562854?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/1562854?s=400&v=4 |
| og:image:alt | 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.toml and introduces a committed pix... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git |
| octolytics-dimension-user_id | 215947 |
| octolytics-dimension-user_login | matplotlib |
| octolytics-dimension-repository_id | 1385122 |
| octolytics-dimension-repository_nwo | matplotlib/matplotlib |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1385122 |
| octolytics-dimension-repository_network_root_nwo | matplotlib/matplotlib |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7aed05249554b889eb33d002851a973eebcc7e91 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width