@@ -177,20 +177,28 @@ project with GUI support, adding the PyQt5 dependency.
177177
178178.. _self-referential-extras :
179179
180- You can also define an extra that refers back to the same project with
180+ You can also define an extra that refers back to the current project with
181181other extras. This is useful for convenience extras that combine several
182- optional features without duplicating their dependency lists:
182+ optional features (such as an ``all `` extra hosting dependencies from both
183+ ``gui `` and ``cli ``):
183184
184185.. code-block :: toml
185186
186- all = ["your-project-name[gui, cli]"]
187+ all = ["your-project-name[gui, cli]"]
187188
188- Installing ``your-project-name[all] `` then installs both the ``gui `` and
189- ``cli `` dependencies. You can also list extras separately, for example
190- ``["your-project-name[gui]", "your-project-name[cli]"] ``. The name in the
191- requirement must match the project's ``name `` field. Installers such as
192- :ref: `pip ` and :ref: `uv ` support this pattern already (pip since
193- `version 21.2 <https://pip.pypa.io/en/latest/reference/requirement-specifiers/#self-referential-extras >`_).
189+ The combined extra does not need its own manually maintained copy of each
190+ referenced extra's dependencies, which can otherwise fall out of sync after
191+ a few years of maintenance and bug fixes:
192+
193+ .. code-block :: toml
194+
195+ gui = ["PyQt5"]
196+ cli = [
197+ "rich>=14.2", # version range is added after last "all" extra update
198+ "textual", # dependency newly added since last "all" extra update
199+ "click",
200+ ]
201+ all = ["PyQt5", "rich", "click"]
194202
195203
196204 .. _requires-python :
0 commit comments