Skip to content

Commit b8e5a79

Browse files
authored
Add an example of pip install --group (#12189)
This is another example for the build customization example gallery, demonstrating how to use `pip` to install from a dependency group. <!-- readthedocs-preview docs start --> --- :books: Documentation previews :books: - User's documentation (`docs`): https://docs--12189.org.readthedocs.build/12189/ <!-- readthedocs-preview docs end --> <!-- readthedocs-preview dev start --> - Developer's documentation (`dev`): https://dev--12189.org.readthedocs.build/12189/ <!-- readthedocs-preview dev end -->
1 parent 7b89de6 commit b8e5a79

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

docs/user/build-customization.rst

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,32 @@ If a ``uv.lock`` file exists it is respected.
486486
install:
487487
- UV_PROJECT_ENVIRONMENT="${READTHEDOCS_VIRTUALENV_PATH}" uv sync --frozen --group docs
488488
489+
Install dependencies from Dependency Groups
490+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
491+
492+
Python `Dependency Groups <https://packaging.python.org/en/latest/specifications/dependency-groups/>`_
493+
are a way of storing lists of dependencies in your ``pyproject.toml``.
494+
495+
``pip`` version 25.1 and later, which is the default for Read the Docs builds,
496+
as well as many other tools support Dependency Groups.
497+
This example uses ``pip`` and installs from a group named ``docs``:
498+
499+
.. code-block:: yaml
500+
:caption: .readthedocs.yaml
501+
502+
version: 2
503+
504+
build:
505+
os: ubuntu-24.04
506+
tools:
507+
python: "3.13"
508+
jobs:
509+
install:
510+
- pip install --group 'docs'
511+
512+
For more information on relevant ``pip`` usage, see the
513+
`pip user guide on Dependency Groups <https://pip.pypa.io/en/stable/user_guide/#dependency-groups>`_.
514+
489515
Update Conda version
490516
~~~~~~~~~~~~~~~~~~~~
491517

0 commit comments

Comments
 (0)