summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorJames Polley <jp@jamezpolley.com>2015-05-11 15:19:37 +1000
committerJames Polley <jp@jamezpolley.com>2015-05-15 21:31:21 +1000
commit2b29c4fc2bec808eed9c72af0d218b503ba3bd2f (patch)
tree47d30996a428abe64bdcc9772793f96572165d29 /doc
parent44ee5f0d0cb5a0290534b06298bb598142425b1e (diff)
downloadpbr-2b29c4fc2bec808eed9c72af0d218b503ba3bd2f.tar.gz
Teach pbr to read extras and env markers
This adds support for reading extras from setup.cfg. It also adds support for handling environment markers, both in the extras section and in install_requires and in requirements.txt. Change-Id: I6fd8276012e65f82934df9c374613b1ce6856b5a
Diffstat (limited to 'doc')
-rw-r--r--doc/source/index.rst39
1 files changed, 39 insertions, 0 deletions
diff --git a/doc/source/index.rst b/doc/source/index.rst
index bc5441d..59fe16f 100644
--- a/doc/source/index.rst
+++ b/doc/source/index.rst
@@ -123,6 +123,45 @@ version number used to install the package):
Only the first file found is used to install the list of packages it
contains.
+Extra requirements
+------------------
+
+Groups of optional dependencies (`"extra" requirements
+<https://www.python.org/dev/peps/pep-0426/#extras-optional-dependencies>`_)
+can be described in your setup.cfg, rather than needing to be added to
+setup.py. An example (which also demonstrates the use of environment
+markers) is shown below.
+
+Environment markers
+-------------------
+
+Environment markers are `conditional dependencies
+<https://www.python.org/dev/peps/pep-0426/#environment-markers>`_
+which can be added to the requirements (or to a group of extra
+requirements) automatically, depending on the environment the
+installer is running in. They can be added to requirements in the
+requirements file, or to extras definied in setup.cfg - but the format
+is slightly different for each.
+
+For ``requirements.txt``::
+
+ argparse; python=='2.6'
+
+will result in the package depending on ``argparse`` only if it's being
+installed into python2.6
+
+For extras specifed in setup.cfg, add an ``extras`` section. For
+instance, to create two groups of extra requirements with additional
+constraints on the environment, you can use::
+
+ [extras]
+ security =
+ aleph
+ bet :python_environment=='3.2'
+ gimel :python_environment=='2.7'
+ testing =
+ quux :python_environment=='2.7'
+
long_description
----------------