Skip to content

Commit f5f3dc5

Browse files
committed
Shorten the guidance on missing extras, avoid library design aspects
1 parent 31a037c commit f5f3dc5

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

‎source/guides/writing-pyproject-toml.rst‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,8 @@ syntax you can use to constrain versions.
164164

165165
You may want to make some of your dependencies optional, if they are
166166
only needed for a specific feature of your package. In that case, put
167-
them in ``optional-dependencies``.
167+
them in ``optional-dependencies``. Your package should remain usable without
168+
these optional dependencies installed.
168169

169170
.. code-block:: toml
170171
@@ -179,11 +180,6 @@ Each of the keys defines a "packaging extra". In the example above, one
179180
could use, e.g., ``pip install your-project-name[gui]`` to install your
180181
project with GUI support, adding the PyQt5 dependency.
181182

182-
To keep your package usable without optional dependencies, import them only where
183-
needed, and handle their absence explicitly. If a user requests a feature whose
184-
dependencies are missing, provide an error message explaining which extra to
185-
install, for example, ``your-project-name[gui]``.
186-
187183
.. _self-referential-extras:
188184

189185
You can also define an extra that refers back to the current project with

0 commit comments

Comments
 (0)