Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 85257fe

Browse files
committed
DEV: add pixi.toml
1 parent 30c3d78 commit 85257fe

6 files changed

Lines changed: 6614 additions & 0 deletions

File tree

.github/workflows/pixi_tests.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
name: Pixi
3+
4+
on:
5+
pull_request:
6+
paths:
7+
- "pixi.lock"
8+
- "pyproject.toml"
9+
- "src/**"
10+
- "lib/**"
11+
- ".github/workflows/pixi.yml"
12+
push:
13+
branches: [main]
14+
paths:
15+
- "pixi.lock"
16+
- "pyproject.toml"
17+
- "src/**"
18+
- "lib/**"
19+
- ".github/workflows/pixi.yml"
20+
workflow_dispatch:
21+
22+
permissions: {}
23+
24+
jobs:
25+
pixi-linux-install:
26+
runs-on: ubuntu-24.04
27+
permissions:
28+
contents: read
29+
30+
steps:
31+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
32+
with:
33+
fetch-depth: 0
34+
persist-credentials: false
35+
36+
- name: Set up pixi and install environment
37+
uses: prefix-dev/[email protected]
38+
with:
39+
pixi-version: v0.66.0
40+
locked: true
41+
cache: true
42+
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
43+
- name: Show pixi info
44+
run: |
45+
pixi info
46+
pixi list
47+
- name: Clean build artifacts
48+
run: |
49+
rm -rf build meson-logs meson-private .mesonpy-*
50+
- name: Install Matplotlib editable
51+
run: pixi run python -m pip install --config-settings=setup-args="-Db_lto=false" --editable .
52+
- name: Smoke test editable install
53+
run: |
54+
pixi run python -c "import matplotlib; print(matplotlib.__version__)"

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,15 @@ ENV/
118118
env.bak/
119119
venv.bak/
120120

121+
# pixi files on top level
122+
pixi.toml
123+
.pixi/
124+
# ignore the lock file, but we want to commit this if lock is purposely made from
125+
# pyproject.toml. If you want the lock file committed, just do `git add -f pixi.lock`
126+
# after generating it.
127+
pixi.lock
128+
129+
121130
# Jupyter files #
122131
#################
123132

doc/devel/development_setup.rst

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,43 @@ setup.
199199

200200
Remember to activate the environment whenever you start working on Matplotlib!
201201

202+
.. tab-item:: pixi environment
203+
204+
A pixi configuration is included in ``pyproject.toml``. The environment
205+
includes the base Matplotlib dependencies, and documentation and testing
206+
dependencies. To install the dependencies::
207+
208+
pixi install
209+
210+
and then to install an editable version on Matplotlib::
211+
212+
pixi run python -m pip install \
213+
--no-build-isolation \
214+
--config-settings=setup-args="-Db_lto=false" \
215+
--editable .
216+
217+
(the ``-Db_lto=false`` is not needed on all platforms). You can test the installation with::
218+
219+
pixi run python -c "import matplotlib; print(matplotlib.__file__)"
220+
221+
Note there are some pixi tasks available as shortcuts::
222+
223+
pixi task list
224+
225+
If you do not want to use ``pixi run`` in front of every command, you can do::
226+
227+
pixi shell
228+
229+
and continue to use pixi as a python environment.
230+
231+
.. note:: do not edit the ``pyproject.toml`` file and commit to the repository, as this
232+
will affect all developers. If you want to change the dependencies, please open an
233+
issue or pull request to discuss the change. If you want a custom ``pixi.toml`` file,
234+
you can create one in your home directory, and it will be used instead of the
235+
repository one. An example is available in ``tools/pixi.example.toml`` that lists the
236+
dependencies needed to build Matplotlib.
237+
238+
.. _pixi: https://pixi.prefix.dev/
202239

203240
Install external dependencies
204241
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0 commit comments

Comments
 (0)