Skip to content

Commit 6289add

Browse files
Add pixi example (#12155)
Pixi is a modern package manager for the conda ecosystem. It's much faster than conda/mamba and also supports lockfiles natively. You can install pixi via asdf (https://github.com/asdf-vm/asdf-plugins/blob/master/plugins/pixi) so the usage within mkdocs should be fairly straightforward. <!-- readthedocs-preview docs start --> --- :books: Documentation previews :books: - User's documentation (`docs`): https://docs--12155.org.readthedocs.build/12155/ <!-- readthedocs-preview docs end --> <!-- readthedocs-preview dev start --> - Developer's documentation (`dev`): https://dev--12155.org.readthedocs.build/12155/ <!-- readthedocs-preview dev end --> Co-authored-by: Eric Holscher <[email protected]>
1 parent ebe4589 commit 6289add

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

docs/user/build-customization.rst

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,35 @@ This example uses ``pip`` and installs from a group named ``docs``:
512512
For more information on relevant ``pip`` usage, see the
513513
`pip user guide on Dependency Groups <https://pip.pypa.io/en/stable/user_guide/#dependency-groups>`_.
514514

515+
Install dependencies with ``pixi``
516+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
517+
518+
Projects can use `pixi <https://github.com/prefix-dev/pixi/>`__,
519+
to install Python dependencies, usually reducing the time taken to install compared to conda or pip.
520+
Take a look at the following example:
521+
522+
523+
.. code-block:: yaml
524+
:caption: .readthedocs.yaml
525+
526+
version: 2
527+
528+
build:
529+
os: ubuntu-24.04
530+
jobs:
531+
create_environment:
532+
- asdf plugin add pixi
533+
- asdf install pixi latest
534+
- asdf global pixi latest
535+
install:
536+
# assuming you have an environment called "docs"
537+
- pixi install -e docs
538+
build:
539+
html:
540+
- pixi run -e docs sphinx-build -T -b html docs $READTHEDOCS_OUTPUT/html
541+
542+
MkDocs projects could use ``NO_COLOR=1 pixi run -e docs mkdocs build --strict --site-dir $READTHEDOCS_OUTPUT/html`` instead.
543+
515544
Update Conda version
516545
~~~~~~~~~~~~~~~~~~~~
517546

0 commit comments

Comments
 (0)