Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 84 additions & 0 deletions .github/workflows/pixi_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
---
name: Pixi

on:
pull_request:
paths:
- "pixi.lock"
- "pyproject.toml"
- "src/**"
- "lib/**"
- ".github/workflows/pixi.yml"
push:
branches: [main]
paths:
- "pixi.lock"
- "pyproject.toml"
- "src/**"
- "lib/**"
- ".github/workflows/pixi.yml"
workflow_dispatch:

permissions: {}

jobs:
check-lockfile:
runs-on: ubuntu-slim
permissions:
contents: read

steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
fetch-depth: 1
persist-credentials: false

- name: Set up pixi
uses: prefix-dev/setup-pixi@v0.9.4
with:
pixi-version: v0.66.0
run-install: false

- name: Check that pixi.lock is up to date
run: |
if ! pixi install --locked --manifest-path pyproject.toml; then
echo "::error file=pixi.lock::pixi.lock is not consistent with pyproject.toml. " \
"Run 'pixi lock' locally and commit the updated pixi.lock."
exit 1
fi

pixi-linux-install:
Comment thread
jklymak marked this conversation as resolved.
needs: check-lockfile
runs-on: ubuntu-slim
permissions:
contents: read

steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
fetch-depth: 0
Comment thread
jklymak marked this conversation as resolved.
persist-credentials: false

- name: Set up pixi and install environment
uses: prefix-dev/setup-pixi@v0.9.4
with:
pixi-version: v0.66.0
locked: true
cache: true
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }}

- name: Show pixi info
run: |
pixi info
pixi list

- name: Clean build artifacts
run: |
rm -rf build meson-logs meson-private .mesonpy-*

- name: Install Matplotlib editable
run: pixi run python -m pip install --config-settings=setup-args="-Db_lto=false" --editable .

- name: Smoke test editable install
run: |
pixi run python -c "import matplotlib; print(matplotlib.__version__)"
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,15 @@ ENV/
env.bak/
venv.bak/

# pixi files on top level
pixi.toml
.pixi/
# ignore the lock file, but we want to commit this if lock is purposely made from
# pyproject.toml. If you want the lock file committed, just do `git add -f pixi.lock`
# after generating it.
pixi.lock


# Jupyter files #
#################

Expand Down
32 changes: 32 additions & 0 deletions doc/devel/development_setup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ setup.

.. _venv: https://docs.python.org/3/library/venv.html
.. _conda: https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html
.. _pixi: https://pixi.prefix.dev/

.. tab-set::

Expand Down Expand Up @@ -199,6 +200,37 @@ setup.

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

.. tab-item:: pixi environment

A `pixi`_ configuration is included in ``pyproject.toml`` that will
install the development dependencies::

pixi install
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need a dedicated pixi install? I assume pixi run would install the needed dependencies automatically? So we could simplify.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose we could just have the one command, but I like keeping them separate so the user knows it was the pixi part that failed, not the pip install part. When these things fail they are pretty opaque...

Copy link
Copy Markdown
Member

@timhoffm timhoffm Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair. OTOH the pixi install failing is quite unlikely. That‘d mean either an issue in the package infrastructure like a failing server) which is beyond our responsibility and should be rare) or it’s a configuration issue on our side. In the latter case we‘d also notice soon as this would also be broken in CI.

I leave this up to you.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm more thinking it may fail on machines we don't test...


and then to install an editable version of Matplotlib::

pixi run python -m pip install \
--no-build-isolation \
--config-settings=setup-args="-Db_lto=false" \
--editable .

(the ``-Db_lto=false`` is not needed on all platforms). You can test the installation with::

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


.. tip::
We provide some pixi tasks as shortcuts for common development tasks,
listed via::

pixi task list

If you do not want to use ``pixi run`` in front of every command, run::

pixi shell

and continue to use pixi as a python environment.


Install external dependencies
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
Loading
Loading