Skip to content

Commit 4b3a010

Browse files
astrofrogwillingcpradyunsg
authored
Apply suggestions from code review
Co-authored-by: Carol Willing <[email protected]> Co-authored-by: Pradyun Gedam <[email protected]>
1 parent 57f05c9 commit 4b3a010

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

peps/pep-0771.rst

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ recommend a default extra to install a backend or frontend include:
9494
* `glueviz <https://www.glueviz.org>`_: ``glueviz[qt]``
9595

9696
In all three cases, installing the package without any extras results in a
97-
broken installation, and this is a commonly reported issue for some of these
97+
broken installation, and this is a commonly reported support issue for some of these
9898
packages.
9999

100100
Rationale
@@ -214,7 +214,7 @@ once with no extras specified.
214214

215215
An empty set of extras, such as ``package[]`` should be interpreted as meaning
216216
that the package should be installed *without* any default extras (unless
217-
``package`` appears elsewhere in the dependency tree as mentioned above), so
217+
``package`` appears elsewhere in the dependency tree as mentioned above). This
218218
would provide a universal way of obtaining a minimal installation of a package.
219219

220220
We also note that some tools such as `pip`_ currently ignore unrecognized
@@ -236,9 +236,9 @@ Finally, we note (as also discussed in `Relying on tooling to deselect
236236
any default extras`_) that package installers are allowed to implement their
237237
own options to control the above behavior, for example implementing an option
238238
that disables default extras for some or all packages regardless of where these
239-
packages appear in the dependency tree -- although if such options are
240-
implemented, they should be opt-in, and users should experience the above
241-
behavior as default.
239+
packages appear in the dependency tree. If such tool-specific options are
240+
implemented, tool developers should make these opt-in,
241+
and users should experience the above PEP 771 behavior as default.
242242

243243
Examples
244244
--------
@@ -673,13 +673,9 @@ In essence, default extras should be considered just as 'weighty' as a required
673673
dependency. In some cases, if a package is widely used by many others, if it
674674
adds a default extra, then unless all downstream packages update their
675675
dependencies to specifically request a minimal installation, the defaults will
676-
often end up getting installed. A concrete example of this is that the `pytest
677-
<https://docs.pytest.org>`_ package has almost 1500 plugins at the time of
678-
writing, all of which depend on pytest. If pytest was to start using a default
679-
extra, it would need to consider this very carefully, as if the plugins are not
680-
updated, installing any plugin will result in the default extra being
681-
installed. This is not to say that it should not use default extras, but just
682-
that the decision should be considered and planned carefully.
676+
Default extras should generally be treated with the same "weight" as required dependencies. When a package is widely used, introducing a default extra will result in that extra's dependencies being transitively included -- unless all downstream packages are updated to explicitly opt out using minimal installation specifications.
677+
678+
As an example, the `pytest <https://docs.pytest.org/>`_ package currently has nearly 1,500 plugins that depend on it. If pytest were to add a default extra and those plugins were not updated accordingly, installing a plugin would include the default extras' dependencies. This doesn’t preclude the use of default extras, but addition of default extras requires careful evaluation of its downstream effects.
683679

684680
Inheriting from default extras
685681
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -752,7 +748,7 @@ Documenting packages with default extras
752748
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
753749

754750
Regardless of how default extras are used, package authors should aim to ensure
755-
that the documentation for their package makes it clear how extras are to be
751+
that their package's documentation makes it clear how extras are to be
756752
used. 'Best practices' documentation should mention:
757753

758754
* that installing ``package`` will be equivalent to ``package[<default extras>]``

0 commit comments

Comments
 (0)