[Python-checkins] peps: PEP 426: optional features or "extra dependencies"

daniel.holth python-checkins at python.org
Sun Mar 10 19:33:16 CET 2013


http://hg.python.org/peps/rev/82a2053a7bff
changeset: 4791:82a2053a7bff
user: Daniel Holth <dholth at fastmail.fm>
date: Sun Mar 10 13:54:12 2013 -0400
summary:
 PEP 426: optional features or "extra dependencies"
files:
 pep-0426.txt | 21 +++++++++++++--------
 1 files changed, 13 insertions(+), 8 deletions(-)
diff --git a/pep-0426.txt b/pep-0426.txt
--- a/pep-0426.txt
+++ b/pep-0426.txt
@@ -1199,14 +1199,15 @@
 =================
 
 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 @@
 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:
 
-- 
Repository URL: http://hg.python.org/peps


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /