Skip to content

Commit 24087b2

Browse files
jklymaktimhoffm
andcommitted
TST: add test that pixi lock file is consistent with pyproject.toml [ci doc]
Apply suggestions from code review Co-authored-by: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com>
1 parent d32b629 commit 24087b2

File tree

2 files changed

+40
-14
lines changed

2 files changed

+40
-14
lines changed

.github/workflows/pixi_tests.yml

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,39 @@ on:
2222
permissions: {}
2323

2424
jobs:
25+
check-lockfile:
26+
runs-on: ubuntu-slim
27+
permissions:
28+
contents: read
29+
30+
steps:
31+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
32+
with:
33+
fetch-depth: 1
34+
persist-credentials: false
35+
36+
- name: Set up pixi
37+
uses: prefix-dev/setup-pixi@v0.9.4
38+
with:
39+
pixi-version: v0.66.0
40+
run-install: false
41+
42+
- name: Check that pixi.lock is up to date
43+
run: |
44+
if ! pixi install --locked --manifest-path pyproject.toml; then
45+
echo "::error file=pixi.lock::pixi.lock is not consistent with pyproject.toml. " \
46+
"Run 'pixi lock' locally and commit the updated pixi.lock."
47+
exit 1
48+
fi
49+
2550
pixi-linux-install:
26-
runs-on: ubuntu-24.04
51+
needs: check-lockfile
52+
runs-on: ubuntu-slim
2753
permissions:
2854
contents: read
2955

3056
steps:
31-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
57+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
3258
with:
3359
fetch-depth: 0
3460
persist-credentials: false
@@ -40,15 +66,19 @@ jobs:
4066
locked: true
4167
cache: true
4268
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
69+
4370
- name: Show pixi info
4471
run: |
4572
pixi info
4673
pixi list
74+
4775
- name: Clean build artifacts
4876
run: |
4977
rm -rf build meson-logs meson-private .mesonpy-*
78+
5079
- name: Install Matplotlib editable
5180
run: pixi run python -m pip install --config-settings=setup-args="-Db_lto=false" --editable .
81+
5282
- name: Smoke test editable install
5383
run: |
5484
pixi run python -c "import matplotlib; print(matplotlib.__version__)"

doc/devel/development_setup.rst

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ setup.
207207

208208
pixi install
209209

210-
and then to install an editable version on Matplotlib::
210+
and then to install an editable version of Matplotlib::
211211

212212
pixi run python -m pip install \
213213
--no-build-isolation \
@@ -218,22 +218,18 @@ setup.
218218

219219
pixi run python -c "import matplotlib; print(matplotlib.__file__)"
220220

221-
Note there are some pixi tasks available as shortcuts::
222221

223-
pixi task list
222+
.. tip::
223+
We provide some pixi tasks as shortcuts for common development tasks,
224+
listed via::
224225

225-
If you do not want to use ``pixi run`` in front of every command, you can do::
226+
pixi task list
226227

227-
pixi shell
228+
If you do not want to use ``pixi run`` in front of every command, you can do::
228229

229-
and continue to use pixi as a python environment.
230+
pixi shell
230231

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.
232+
and continue to use pixi as a python environment.
237233

238234
.. _pixi: https://pixi.prefix.dev/
239235

0 commit comments

Comments
 (0)