PEP 426: optional features or "extra dependencies"

This commit is contained in:
Daniel Holth 2013-03-10 13:54:12 -04:00
parent 405a5ad476
commit 9800c40ecb
1 changed files with 13 additions and 8 deletions

View File

@ -1199,14 +1199,15 @@ Optional features
=================
Distributions may use the ``Provides-Extra`` field to declare additional
features that they provide. Environment markers may then be used to indicate
features provided through "extra" dependencies, usually corresponding to a
``try: import x ...`` block. Environment markers may be used to indicate
that particular dependencies are needed only when a particular optional
feature has been requested.
Other distributions then require an optional feature by placing it
inside square brackets after the distribution name when declaring the
dependency. Multiple features can be requisted by separating them with a
comma within the brackets.
Other distributions require the feature by placing it inside
square brackets after the distribution name when declaring the
dependency. Multiple features can be requisted by separating them with
a comma within the brackets.
The full set of dependency requirements is then the union of the sets
created by first evaluating the `Requires-Dist` fields with `extra`
@ -1220,9 +1221,13 @@ Example::
Setup-Requires-Dist: beaglevote[test, doc]
-> requires beaglevote, sphinx, nose at setup time
It is legal to specify `Provides-Extra` without referencing it in any
`Requires-Dist`. It is an error to request a feature name that has
not been declared with `Provides-Extra`.
It is an error to request a feature name that has not been declared with
`Provides-Extra` but it is legal to specify `Provides-Extra` without
referencing it in any `Requires-Dist`.
In the example, if ``beaglevote`` grew the ability to generate PDF
without extra dependencies, it should continue to ``Provides-Extra:
pdf`` for the benefit of dependent distributions.
The following feature names are implicitly defined for all distributions: