Commits

Ryan Macy  committed 96f764b

Adjusted spacing and fixed a typo

  • Participants
  • Parent commits fd6e672

Comments (0)

Files changed (9)

File docs/database.rst

 =================================================================
 
 .. module:: distlib.database
-    :synopsis: Functions to query and manipulate installed distributions.
+   :synopsis: Functions to query and manipulate installed distributions.
 
 This module provides an implementation of :PEP:`376`.
 
 
 .. class:: InstalledDistribution(path)
 
-    Class representing an installed distribution.
+   Class representing an installed distribution.
 
-    Instantiate with the *path* to a ``.dist-info`` directory.  Instances can be
-    compared and sorted.  Other available methods are:
+   Instantiate with the *path* to a ``.dist-info`` directory.  Instances can be
+   compared and sorted.  Other available methods are:
 
-    .. XXX describe how comparison works
+   .. XXX describe how comparison works
 
-    .. method:: get_distinfo_file(path, binary=False)
+   .. method:: get_distinfo_file(path, binary=False)
 
-        Return a read-only file object for a file located at
-        :file:`{project}-{version}.dist-info/{path}`.  *path* should be a
-        ``'/'``-separated path relative to the ``.dist-info`` directory or an
-        absolute path; if it is an absolute path and doesn't start with the path
-        to the :file:`.dist-info` directory, a :class:`DistlibException` is
-        raised.
+      Return a read-only file object for a file located at
+      :file:`{project}-{version}.dist-info/{path}`.  *path* should be a
+      ``'/'``-separated path relative to the ``.dist-info`` directory or an
+      absolute path; if it is an absolute path and doesn't start with the path
+      to the :file:`.dist-info` directory, a :class:`DistlibException` is
+      raised.
 
-        If *binary* is ``True``, the file is opened in binary mode.
+      If *binary* is ``True``, the file is opened in binary mode.
 
-    .. method:: get_resource_path(relative_path)
+   .. method:: get_resource_path(relative_path)
 
-        .. TODO
+      .. TODO
 
-    .. method:: list_distinfo_files(local=False)
+   .. method:: list_distinfo_files(local=False)
 
-        Return an iterator over all files located in the :file:`.dist-info`
-        directory.  If *local* is ``True``, each returned path is transformed into
-        a local absolute path, otherwise the raw value found in the :file:`RECORD`
-        file is returned.
+      Return an iterator over all files located in the :file:`.dist-info`
+      directory.  If *local* is ``True``, each returned path is transformed into
+      a local absolute path, otherwise the raw value found in the :file:`RECORD`
+      file is returned.
 
-    .. method::  list_installed_files(local=False)
+   .. method::  list_installed_files(local=False)
 
-        Iterate over the files installed with the distribution and registered in
-        the :file:`RECORD` file and yield a tuple ``(path, md5, size)`` for each
-        line.  If *local* is ``True``, the returned path is transformed into a
-        local absolute path, otherwise the raw value is returned.
+      Iterate over the files installed with the distribution and registered in
+      the :file:`RECORD` file and yield a tuple ``(path, md5, size)`` for each
+      line.  If *local* is ``True``, the returned path is transformed into a
+      local absolute path, otherwise the raw value is returned.
 
-        A local absolute path is an absolute path in which occurrences of ``'/'``
-        have been replaced by :data:`os.sep`.
+      A local absolute path is an absolute path in which occurrences of ``'/'``
+      have been replaced by :data:`os.sep`.
 
-    .. method:: uses(path)
+   .. method:: uses(path)
 
-        Check whether *path* was installed by this distribution (i.e. if the path
-        is present in the :file:`RECORD` file). *path* can be a local absolute
-        path or a relative ``'/'``-separated path. Returns a boolean.
+      Check whether *path* was installed by this distribution (i.e. if the path
+      is present in the :file:`RECORD` file). *path* can be a local absolute
+      path or a relative ``'/'``-separated path. Returns a boolean.
 
-    Available attributes:
+   Available attributes:
 
-    .. attribute:: metadata
+   .. attribute:: metadata
 
-        Instance of :class:`distlib.metadata.Metadata` filled with the contents
-        of the :file:`{project}-{version}.dist-info/METADATA` file.
+      Instance of :class:`distlib.metadata.Metadata` filled with the contents
+      of the :file:`{project}-{version}.dist-info/METADATA` file.
 
-    .. attribute:: name
+   .. attribute:: name
 
-        Shortcut for ``metadata['Name']``.
+      Shortcut for ``metadata['Name']``.
 
-    .. attribute:: version
+   .. attribute:: version
 
-        Shortcut for ``metadata['Version']``.
+      Shortcut for ``metadata['Version']``.
 
-    .. attribute:: requested
+   .. attribute:: requested
 
-        Boolean indicating whether this distribution was requested by the user of
-        automatically installed as a dependency.
+      Boolean indicating whether this distribution was requested by the user of
+      automatically installed as a dependency.
 
 .. class:: EggInfoDistribution(path)
 
-    Class representing a legacy distribution.  It is compatible with distutils'
-    and setuptools' :file:`.egg-info` and :file:`.egg` files and directories.
+   Class representing a legacy distribution.  It is compatible with distutils'
+   and setuptools' :file:`.egg-info` and :file:`.egg` files and directories.
 
-    .. FIXME should be named EggDistribution
+   .. FIXME should be named EggDistribution
 
-    Instantiate with the *path* to an egg file or directory. Instances can be
-    compared and sorted. Other available methods are:
+   Instantiate with the *path* to an egg file or directory. Instances can be
+   compared and sorted. Other available methods are:
 
-    .. method:: list_installed_files(local=False)
+   .. method:: list_installed_files(local=False)
 
-    .. method:: uses(path)
+   .. method:: uses(path)
 
-    Available attributes:
+   Available attributes:
 
-    .. attribute:: metadata
+   .. attribute:: metadata
 
-        Instance of :class:`distlib.metadata.Metadata` filled with the contents
-        of the :file:`{project-version}.egg-info/PKG-INFO` or
-        :file:`{project-version}.egg` file.
+      Instance of :class:`distlib.metadata.Metadata` filled with the contents
+      of the :file:`{project-version}.egg-info/PKG-INFO` or
+      :file:`{project-version}.egg` file.
 
-    .. attribute:: name
+   .. attribute:: name
 
-        Shortcut for ``metadata['Name']``.
+      Shortcut for ``metadata['Name']``.
 
-    .. attribute:: version
+   .. attribute:: version
 
-        Shortcut for ``metadata['Version']``.
+      Shortcut for ``metadata['Version']``.
 
 Functions to work with the database
 -----------------------------------
 
 .. function:: get_distribution(name, use_egg_info=False, paths=None)
 
-    Return an instance of :class:`Distribution` or :class:`EggInfoDistribution`
-    for the first installed distribution matching *name*.  Egg distributions are
-    considered only if *use_egg_info* is true; if both a dist-info and an egg
-    file are found, the dist-info prevails.  The directories to be searched are
-    given in *paths*, which defaults to :data:`sys.path`.  Returns ``None`` if no
-    matching distribution is found.
+   Return an instance of :class:`Distribution` or :class:`EggInfoDistribution`
+   for the first installed distribution matching *name*.  Egg distributions are
+   considered only if *use_egg_info* is true; if both a dist-info and an egg
+   file are found, the dist-info prevails.  The directories to be searched are
+   given in *paths*, which defaults to :data:`sys.path`.  Returns ``None`` if no
+   matching distribution is found.
 
-    .. FIXME param should be named use_egg
+   .. FIXME param should be named use_egg
 
 .. function:: get_distributions(use_egg_info=False, paths=None)
 
-    Return an iterator of :class:`Distribution` instances for all installed
-    distributions found in *paths* (defaults to :data:`sys.path`).  If
-    *use_egg_info* is true, also return instances of :class:`EggInfoDistribution`
-    for legacy distributions found.
+   Return an iterator of :class:`Distribution` instances for all installed
+   distributions found in *paths* (defaults to :data:`sys.path`).  If
+   *use_egg_info* is true, also return instances of :class:`EggInfoDistribution`
+   for legacy distributions found.
 
 .. function:: get_file_users(path)
 
-    Return an iterator over all distributions using *path*, a local absolute path
-    or a relative ``'/'``-separated path.
+   Return an iterator over all distributions using *path*, a local absolute path
+   or a relative ``'/'``-separated path.
 
-    .. XXX does this work with prefixes or full file path only?
+   .. XXX does this work with prefixes or full file path only?
 
 .. function:: obsoletes_distribution(name, version=None, use_egg_info=False)
 
-    Return an iterator over all distributions that declare they obsolete *name*.
-    *version* is an optional argument to match only specific releases (see
-    :mod:`distlib.version`).  If *use_egg_info* is true, legacy egg
-    distributions will be considered as well.
+   Return an iterator over all distributions that declare they obsolete *name*.
+   *version* is an optional argument to match only specific releases (see
+   :mod:`distlib.version`).  If *use_egg_info* is true, legacy egg
+   distributions will be considered as well.
 
 .. function:: provides_distribution(name, version=None, use_egg_info=False)
 
-    Return an iterator over all distributions that declare they provide *name*.
-    *version* is an optional argument to match only specific releases (see
-    :mod:`distlib.version`).  If *use_egg_info* is true, legacy egg
-    distributions will be considered as well.
+   Return an iterator over all distributions that declare they provide *name*.
+   *version* is an optional argument to match only specific releases (see
+   :mod:`distlib.version`).  If *use_egg_info* is true, legacy egg
+   distributions will be considered as well.
 
 Utility functions
 -----------------
 
 .. function:: distinfo_dirname(name, version)
 
-    Escape *name* and *version* into a filename-safe form and return the
-    directory name built from them, for example
-    :file:`{safename}-{safeversion}.dist-info.`  In *name* runs of
-    non-alphanumeric characters are replaced with one ``'_'``, in *version*
-    spaces become dots, and runs of other non-alphanumeric characters (except
-    dots) are replaced by one ``'-'``.
+   Escape *name* and *version* into a filename-safe form and return the
+   directory name built from them, for example
+   :file:`{safename}-{safeversion}.dist-info.`  In *name* runs of
+   non-alphanumeric characters are replaced with one ``'_'``, in *version*
+   spaces become dots, and runs of other non-alphanumeric characters (except
+   dots) are replaced by one ``'-'``.
 
-    .. XXX wth spaces in version numbers?
+   .. XXX wth spaces in version numbers?
 
 For performance purposes, the list of distributions is being internally
 cached. Caching is enabled by default, but you can control it with these
 
 .. function:: clear_cache()
 
-    Clear the cache.
+   Clear the cache.
 
 .. function:: disable_cache()
 
-    Disable the cache, without clearing it.
+   Disable the cache, without clearing it.
 
 .. function:: enable_cache()
 
-    Enable the internal cache, without clearing it.
+   Enable the internal cache, without clearing it.
 
 Examples
 --------
 
 .. code-block:: none
 
-    Information about 'choxie'
+   Information about 'choxie'
 
-    Files
-    =====
-    * Path: ../tmp/distutils2/tests/fake_dists/choxie-2.0.0.9/truffles.py
-    Hash 5e052db6a478d06bad9ae033e6bc08af, Size: 111 bytes
-    * Path: ../tmp/distutils2/tests/fake_dists/choxie-2.0.0.9/choxie/chocolate.py
-    Hash ac56bf496d8d1d26f866235b95f31030, Size: 214 bytes
-    * Path: ../tmp/distutils2/tests/fake_dists/choxie-2.0.0.9/choxie/__init__.py
-    Hash 416aab08dfa846f473129e89a7625bbc, Size: 25 bytes
-    * Path: ../tmp/distutils2/tests/fake_dists/choxie-2.0.0.9.dist-info/INSTALLER
-    Hash d41d8cd98f00b204e9800998ecf8427e, Size: 0 bytes
-    * Path: ../tmp/distutils2/tests/fake_dists/choxie-2.0.0.9.dist-info/METADATA
-    Hash 696a209967fef3c8b8f5a7bb10386385, Size: 225 bytes
-    * Path: ../tmp/distutils2/tests/fake_dists/choxie-2.0.0.9.dist-info/REQUESTED
-    Hash d41d8cd98f00b204e9800998ecf8427e, Size: 0 bytes
-    * Path: ../tmp/distutils2/tests/fake_dists/choxie-2.0.0.9.dist-info/RECORD
-    Hash None, Size: None bytes
+   Files
+   =====
+   * Path: ../tmp/distutils2/tests/fake_dists/choxie-2.0.0.9/truffles.py
+     Hash 5e052db6a478d06bad9ae033e6bc08af, Size: 111 bytes
+   * Path: ../tmp/distutils2/tests/fake_dists/choxie-2.0.0.9/choxie/chocolate.py
+     Hash ac56bf496d8d1d26f866235b95f31030, Size: 214 bytes
+   * Path: ../tmp/distutils2/tests/fake_dists/choxie-2.0.0.9/choxie/__init__.py
+     Hash 416aab08dfa846f473129e89a7625bbc, Size: 25 bytes
+   * Path: ../tmp/distutils2/tests/fake_dists/choxie-2.0.0.9.dist-info/INSTALLER
+     Hash d41d8cd98f00b204e9800998ecf8427e, Size: 0 bytes
+   * Path: ../tmp/distutils2/tests/fake_dists/choxie-2.0.0.9.dist-info/METADATA
+     Hash 696a209967fef3c8b8f5a7bb10386385, Size: 225 bytes
+   * Path: ../tmp/distutils2/tests/fake_dists/choxie-2.0.0.9.dist-info/REQUESTED
+     Hash d41d8cd98f00b204e9800998ecf8427e, Size: 0 bytes
+   * Path: ../tmp/distutils2/tests/fake_dists/choxie-2.0.0.9.dist-info/RECORD
+     Hash None, Size: None bytes
 
-    Metadata
-    ========
+   Metadata
+   ========
        Metadata-Version: 1.2
                    Name: choxie
                 Version: 2.0.0.9
         Requires-Python: UNKNOWN
       Requires-External: []
 
-    Extra
-    =====
-    * It was installed as a dependency
+   Extra
+   =====
+   * It was installed as a dependency
 
 Getting metadata about a distribution
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 .. code-block:: none
 
-    'strawberry' 0.6 is obsoleted by 'choxie'
-    'grammar' 1.0a4 is obsoleted by 'towel-stuff'
+   'strawberry' 0.6 is obsoleted by 'choxie'
+   'grammar' 1.0a4 is obsoleted by 'towel-stuff'

File docs/depgraph.rst

 
 .. class:: DependencyGraph
 
-    Represent a dependency graph between releases.  The nodes are distribution
-    instances, the edge model dependencies.  An edge from ``a`` to ``b`` means
-    that ``a`` depends on ``b``.
+   Represent a dependency graph between releases.  The nodes are distribution
+   instances, the edge model dependencies.  An edge from ``a`` to ``b`` means
+   that ``a`` depends on ``b``.
 
-    .. method:: add_distribution(distribution)
+   .. method:: add_distribution(distribution)
 
-        Add *distribution* to the graph.
+      Add *distribution* to the graph.
 
-    .. method:: add_edge(x, y, label=None)
+   .. method:: add_edge(x, y, label=None)
 
-        Add an edge from distribution *x* to distribution *y* with the given
-        *label* (string).
+      Add an edge from distribution *x* to distribution *y* with the given
+      *label* (string).
 
-    .. method:: add_missing(distribution, requirement)
+   .. method:: add_missing(distribution, requirement)
 
-        Add a missing *requirement* (string) for the given *distribution*.
+      Add a missing *requirement* (string) for the given *distribution*.
 
-    .. method:: repr_node(dist, level=1)
+   .. method:: repr_node(dist, level=1)
 
-        Print a subgraph starting from *dist*.  *level* gives the depth of the
-        subgraph.
+      Print a subgraph starting from *dist*.  *level* gives the depth of the
+      subgraph.
 
-    Direct access to the graph nodes and edges is provided through these
-    attributes:
+   Direct access to the graph nodes and edges is provided through these
+   attributes:
 
-    .. attribute:: adjacency_list
+   .. attribute:: adjacency_list
 
-        Dictionary mapping distributions to a list of ``(other, label)`` tuples
-        where  ``other`` is a distribution and the edge is labeled with ``label``
-        (i.e. the version specifier, if such was provided).
+      Dictionary mapping distributions to a list of ``(other, label)`` tuples
+      where  ``other`` is a distribution and the edge is labeled with ``label``
+      (i.e. the version specifier, if such was provided).
 
-    .. attribute:: reverse_list
+   .. attribute:: reverse_list
 
-        Dictionary mapping distributions to a list of predecessors.  This allows
-        efficient traversal.
+      Dictionary mapping distributions to a list of predecessors.  This allows
+      efficient traversal.
 
-    .. attribute:: missing
+   .. attribute:: missing
 
-        Dictionary mapping distributions to a list of requirements that were not
-        provided by any distribution.
+      Dictionary mapping distributions to a list of requirements that were not
+      provided by any distribution.
 
 Auxiliary functions
 -------------------
 
 .. function:: get_dependent_dists(dists, dist)
 
-    Recursively generate a list of distributions from *dists* that are dependent
-    on *dist*.
+   Recursively generate a list of distributions from *dists* that are dependent
+   on *dist*.
 
-    .. XXX what does member mean here: "dist is a member of *dists* for which we
-    are interested"
+   .. XXX what does member mean here: "dist is a member of *dists* for which we
+   are interested"
 
 .. function:: make_graph(dists)
 
-    Generate a :class:`DependencyGraph` from the given list of distributions.
+   Generate a :class:`DependencyGraph` from the given list of distributions.
 
 Example Usage
 -------------
 
-Depict all dependenciess in the system
+Depict all dependencies in the system
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 First, we shall generate a graph of all the distributions on the system
 
 .. code-block:: none
 
-     Missing dependencies for 'TurboCheetah': 'Cheetah'
-     Missing dependencies for 'TurboGears': 'ConfigObj', 'DecoratorTools', 'RuleDispatch'
-     Missing dependencies for 'jockey': 'PyKDE4.kdecore', 'PyKDE4.kdeui', 'PyQt4.QtCore', 'PyQt4.QtGui'
-     Missing dependencies for 'TurboKid': 'kid'
-     Missing dependencies for 'TurboJson: 'DecoratorTools', 'RuleDispatch'
+   Missing dependencies for 'TurboCheetah': 'Cheetah'
+   Missing dependencies for 'TurboGears': 'ConfigObj', 'DecoratorTools', 'RuleDispatch'
+   Missing dependencies for 'jockey': 'PyKDE4.kdecore', 'PyKDE4.kdeui', 'PyQt4.QtCore', 'PyQt4.QtGui'
+   Missing dependencies for 'TurboKid': 'kid'
+   Missing dependencies for 'TurboJson: 'DecoratorTools', 'RuleDispatch'
 
 Now, we proceed with generating a graphical representation of the graph. First
 we write it to a file, and then we generate a PNG image using the
 
 .. code-block:: sh
 
-    $ dot -Tpng output.dot > output.png
+   $ dot -Tpng output.dot > output.png
 
 An example result is:
 
 .. figure:: depgraph-output.png
-    :alt: Example PNG output from distlib.depgraph and dot
+   :alt: Example PNG output from distlib.depgraph and dot
 
 If you want to include egg distributions as well, then the code requires only
 one change, namely the line::
 
 .. XXX missing image
 
-    An example of a more involved graph for illustrative reasons can be seen
-    here:
+   An example of a more involved graph for illustrative reasons can be seen
+   here:
 
-    .. image:: depgraph_big.png
+   .. image:: depgraph_big.png
 
 List all dependent distributions
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 .. code-block:: none
 
-    Distributions depending on 'bacon': 'towel-stuff', 'choxie', 'grammar'
+   Distributions depending on 'bacon': 'towel-stuff', 'choxie', 'grammar'

File docs/dist.rst

 ================================================
 
 .. module:: packaging.dist
-    :synopsis: Core Distribution class.
+   :synopsis: Core Distribution class.
 
 
 This module provides the :class:`Distribution` class, which represents the
 
 .. class:: Distribution(arguments)
 
-    A :class:`Distribution` describes how to build, package, distribute and
-    install a Python project.
+   A :class:`Distribution` describes how to build, package, distribute and
+   install a Python project.
 
-    The arguments accepted by the constructor are laid out in the following
-    table.  Some of them will end up in a metadata object, the rest will become
-    data attributes of the :class:`Distribution` instance.
+   The arguments accepted by the constructor are laid out in the following
+   table.  Some of them will end up in a metadata object, the rest will become
+   data attributes of the :class:`Distribution` instance.
 
-    .. TODO improve constructor to take a Metadata object + named params?
-       (i.e. Distribution(metadata, cmdclass, py_modules, etc)
-    .. TODO also remove obsolete(?) script_name, etc. parameters?  see what
-       py2exe and other tools need
+   .. TODO improve constructor to take a Metadata object + named params?
+      (i.e. Distribution(metadata, cmdclass, py_modules, etc)
+   .. TODO also remove obsolete(?) script_name, etc. parameters?  see what
+      py2exe and other tools need
 
-    +--------------------+--------------------------------+-------------------------------------------------------------+
-    | argument name      | value                          | type                                                        |
-    +====================+================================+=============================================================+
-    | *name*             | The name of the project        | a string                                                    |
-    +--------------------+--------------------------------+-------------------------------------------------------------+
-    | *version*          | The version number of the      | a string                                                    |
-    |                    | release; see                   |                                                             |
-    |                    | :mod:`packaging.version`       |                                                             |
-    +--------------------+--------------------------------+-------------------------------------------------------------+
-    | *summary*          | A single line describing the   | a string                                                    |
-    |                    | project                        |                                                             |
-    +--------------------+--------------------------------+-------------------------------------------------------------+
-    | *description*      | Longer description of the      | a string                                                    |
-    |                    | project                        |                                                             |
-    +--------------------+--------------------------------+-------------------------------------------------------------+
-    | *author*           | The name of the project author | a string                                                    |
-    +--------------------+--------------------------------+-------------------------------------------------------------+
-    | *author_email*     | The email address of the       | a string                                                    |
-    |                    | project author                 |                                                             |
-    +--------------------+--------------------------------+-------------------------------------------------------------+
-    | *maintainer*       | The name of the current        | a string                                                    |
-    |                    | maintainer, if different from  |                                                             |
-    |                    | the author                     |                                                             |
-    +--------------------+--------------------------------+-------------------------------------------------------------+
-    | *maintainer_email* | The email address of the       | a string                                                    |
-    |                    | current maintainer, if         |                                                             |
-    |                    | different from the author      |                                                             |
-    +--------------------+--------------------------------+-------------------------------------------------------------+
-    | *home_page*        | A URL for the proejct          | a string                                                    |
-    |                    | (homepage)                     |                                                             |
-    +--------------------+--------------------------------+-------------------------------------------------------------+
-    | *download_url*     | A URL to download the project  | a string                                                    |
-    +--------------------+--------------------------------+-------------------------------------------------------------+
-    | *packages*         | A list of Python packages that | a list of strings                                           |
-    |                    | packaging will manipulate      |                                                             |
-    +--------------------+--------------------------------+-------------------------------------------------------------+
-    | *py_modules*       | A list of Python modules that  | a list of strings                                           |
-    |                    | packaging will manipulate      |                                                             |
-    +--------------------+--------------------------------+-------------------------------------------------------------+
-    | *scripts*          | A list of standalone scripts   | a list of strings                                           |
-    |                    | to be built and installed      |                                                             |
-    +--------------------+--------------------------------+-------------------------------------------------------------+
-    | *ext_modules*      | A list of Python extensions to | a list of instances of                                      |
-    |                    | be built                       | :class:`packaging.compiler.extension.Extension`             |
-    +--------------------+--------------------------------+-------------------------------------------------------------+
-    | *classifiers*      | A list of categories for the   | a list of strings; valid classifiers are listed on `PyPi    |
-    |                    | distribution                   | <http://pypi.python.org/pypi?:action=list_classifiers>`_.   |
-    +--------------------+--------------------------------+-------------------------------------------------------------+
-    | *distclass*        | the :class:`Distribution`      | a subclass of                                               |
-    |                    | class to use                   | :class:`packaging.dist.Distribution`                        |
-    +--------------------+--------------------------------+-------------------------------------------------------------+
-    | *script_name*      | The name of the setup.py       | a string                                                    |
-    |                    | script - defaults to           |                                                             |
-    |                    | ``sys.argv[0]``                |                                                             |
-    +--------------------+--------------------------------+-------------------------------------------------------------+
-    | *script_args*      | Arguments to supply to the     | a list of strings                                           |
-    |                    | setup script                   |                                                             |
-    +--------------------+--------------------------------+-------------------------------------------------------------+
-    | *options*          | default options for the setup  | a string                                                    |
-    |                    | script                         |                                                             |
-    +--------------------+--------------------------------+-------------------------------------------------------------+
-    | *license*          | The license for the            | a string                                                    |
-    |                    | distribution; should be used   |                                                             |
-    |                    | when there is no suitable      |                                                             |
-    |                    | License classifier, or to      |                                                             |
-    |                    | refine a classifier            |                                                             |
-    +--------------------+--------------------------------+-------------------------------------------------------------+
-    | *keywords*         | Descriptive keywords; used by  | a list of strings or a comma-separated string               |
-    |                    | catalogs such as PyPI          |                                                             |
-    +--------------------+--------------------------------+-------------------------------------------------------------+
-    | *platforms*        | Platforms compatible with this | a list of strings or a comma-separated string               |
-    |                    | distribution; should be used   |                                                             |
-    |                    | when there is no suitable      |                                                             |
-    |                    | Platform classifier            |                                                             |
-    +--------------------+--------------------------------+-------------------------------------------------------------+
-    | *cmdclass*         | A mapping of command names to  | a dictionary                                                |
-    |                    | :class:`Command` subclasses    |                                                             |
-    +--------------------+--------------------------------+-------------------------------------------------------------+
-    | *data_files*       | A list of data files to        | a list                                                      |
-    |                    | install                        |                                                             |
-    +--------------------+--------------------------------+-------------------------------------------------------------+
-    | *package_dir*      | A mapping of Python packages   | a dictionary                                                |
-    |                    | to directory names             |                                                             |
-    +--------------------+--------------------------------+-------------------------------------------------------------+
+   +--------------------+--------------------------------+-------------------------------------------------------------+
+   | argument name      | value                          | type                                                        |
+   +====================+================================+=============================================================+
+   | *name*             | The name of the project        | a string                                                    |
+   +--------------------+--------------------------------+-------------------------------------------------------------+
+   | *version*          | The version number of the      | a string                                                    |
+   |                    | release; see                   |                                                             |
+   |                    | :mod:`packaging.version`       |                                                             |
+   +--------------------+--------------------------------+-------------------------------------------------------------+
+   | *summary*          | A single line describing the   | a string                                                    |
+   |                    | project                        |                                                             |
+   +--------------------+--------------------------------+-------------------------------------------------------------+
+   | *description*      | Longer description of the      | a string                                                    |
+   |                    | project                        |                                                             |
+   +--------------------+--------------------------------+-------------------------------------------------------------+
+   | *author*           | The name of the project author | a string                                                    |
+   +--------------------+--------------------------------+-------------------------------------------------------------+
+   | *author_email*     | The email address of the       | a string                                                    |
+   |                    | project author                 |                                                             |
+   +--------------------+--------------------------------+-------------------------------------------------------------+
+   | *maintainer*       | The name of the current        | a string                                                    |
+   |                    | maintainer, if different from  |                                                             |
+   |                    | the author                     |                                                             |
+   +--------------------+--------------------------------+-------------------------------------------------------------+
+   | *maintainer_email* | The email address of the       | a string                                                    |
+   |                    | current maintainer, if         |                                                             |
+   |                    | different from the author      |                                                             |
+   +--------------------+--------------------------------+-------------------------------------------------------------+
+   | *home_page*        | A URL for the proejct          | a string                                                    |
+   |                    | (homepage)                     |                                                             |
+   +--------------------+--------------------------------+-------------------------------------------------------------+
+   | *download_url*     | A URL to download the project  | a string                                                    |
+   +--------------------+--------------------------------+-------------------------------------------------------------+
+   | *packages*         | A list of Python packages that | a list of strings                                           |
+   |                    | packaging will manipulate      |                                                             |
+   +--------------------+--------------------------------+-------------------------------------------------------------+
+   | *py_modules*       | A list of Python modules that  | a list of strings                                           |
+   |                    | packaging will manipulate      |                                                             |
+   +--------------------+--------------------------------+-------------------------------------------------------------+
+   | *scripts*          | A list of standalone scripts   | a list of strings                                           |
+   |                    | to be built and installed      |                                                             |
+   +--------------------+--------------------------------+-------------------------------------------------------------+
+   | *ext_modules*      | A list of Python extensions to | a list of instances of                                      |
+   |                    | be built                       | :class:`packaging.compiler.extension.Extension`             |
+   +--------------------+--------------------------------+-------------------------------------------------------------+
+   | *classifiers*      | A list of categories for the   | a list of strings; valid classifiers are listed on `PyPi    |
+   |                    | distribution                   | <http://pypi.python.org/pypi?:action=list_classifiers>`_.   |
+   +--------------------+--------------------------------+-------------------------------------------------------------+
+   | *distclass*        | the :class:`Distribution`      | a subclass of                                               |
+   |                    | class to use                   | :class:`packaging.dist.Distribution`                        |
+   +--------------------+--------------------------------+-------------------------------------------------------------+
+   | *script_name*      | The name of the setup.py       | a string                                                    |
+   |                    | script - defaults to           |                                                             |
+   |                    | ``sys.argv[0]``                |                                                             |
+   +--------------------+--------------------------------+-------------------------------------------------------------+
+   | *script_args*      | Arguments to supply to the     | a list of strings                                           |
+   |                    | setup script                   |                                                             |
+   +--------------------+--------------------------------+-------------------------------------------------------------+
+   | *options*          | default options for the setup  | a string                                                    |
+   |                    | script                         |                                                             |
+   +--------------------+--------------------------------+-------------------------------------------------------------+
+   | *license*          | The license for the            | a string                                                    |
+   |                    | distribution; should be used   |                                                             |
+   |                    | when there is no suitable      |                                                             |
+   |                    | License classifier, or to      |                                                             |
+   |                    | refine a classifier            |                                                             |
+   +--------------------+--------------------------------+-------------------------------------------------------------+
+   | *keywords*         | Descriptive keywords; used by  | a list of strings or a comma-separated string               |
+   |                    | catalogs such as PyPI          |                                                             |
+   +--------------------+--------------------------------+-------------------------------------------------------------+
+   | *platforms*        | Platforms compatible with this | a list of strings or a comma-separated string               |
+   |                    | distribution; should be used   |                                                             |
+   |                    | when there is no suitable      |                                                             |
+   |                    | Platform classifier            |                                                             |
+   +--------------------+--------------------------------+-------------------------------------------------------------+
+   | *cmdclass*         | A mapping of command names to  | a dictionary                                                |
+   |                    | :class:`Command` subclasses    |                                                             |
+   +--------------------+--------------------------------+-------------------------------------------------------------+
+   | *data_files*       | A list of data files to        | a list                                                      |
+   |                    | install                        |                                                             |
+   +--------------------+--------------------------------+-------------------------------------------------------------+
+   | *package_dir*      | A mapping of Python packages   | a dictionary                                                |
+   |                    | to directory names             |                                                             |
+   +--------------------+--------------------------------+-------------------------------------------------------------+

File docs/index.rst

 **Please note:** this documentation is a *work in progress*.
 
 .. toctree::
-    :maxdepth: 4
+   :maxdepth: 4
 
-    overview
-    tutorial
-    internals
-    reference
-    migration
+   overview
+   tutorial
+   internals
+   reference
+   migration

File docs/metadata.rst

 ===============================================
 
 .. module:: distlib.metadata
-    :synopsis: Class holding the metadata of a release.
+   :synopsis: Class holding the metadata of a release.
 
 .. warning:: This documentation has not been updated since being copied over
    from ``distutils2`` and may not be up to date.
 
 .. class:: Metadata
 
-    This class can read and write metadata files complying with any of the
-    defined versions: 1.0 (:PEP:`241`), 1.1 (:PEP:`314`) and 1.2 (:PEP:`345`).
-    It implements methods to parse Metadata files and write them and a mapping
-    interface to its contents.
+   This class can read and write metadata files complying with any of the
+   defined versions: 1.0 (:PEP:`241`), 1.1 (:PEP:`314`) and 1.2 (:PEP:`345`).
+   It implements methods to parse Metadata files and write them and a mapping
+   interface to its contents.
 
-    The :PEP:`345` implementation supports the micro-language for the environment
-    markers and displays warnings when versions that are supposed to be
-    :PEP:`386`-compliant are violating the specification.
+   The :PEP:`345` implementation supports the micro-language for the environment
+   markers and displays warnings when versions that are supposed to be
+   :PEP:`386`-compliant are violating the specification.
 
 Reading metadata
 ----------------
 ================================================
 
 .. module:: distlib.markers
-    :synopsis: Micro-language for environment markers
+   :synopsis: Micro-language for environment markers
 
 This is an implementation of environment markers `as defined in PEP 345
 <http://www.python.org/dev/peps/pep-0345/#environment-markers>`_.  It is used
 
 .. function:: interpret(marker, execution_context=None)
 
-    Interpret a marker and return a boolean result depending on the environment.
-    Example::
+   Interpret a marker and return a boolean result depending on the environment.
+   Example::
 
-        >>> interpret("python_version > '1.0'")
-        True
-        >>>
+    >>> interpret("python_version > '1.0'")
+    True
+    >>>
 

File docs/migration.rst

 need.
 
 ``load_entry_point(distname, groupname, name)``
-    ``dist.exports[groupname][name].value``
+   ``dist.exports[groupname][name].value``
 
 ``get_entry_info(distname, groupname, name)``
-    ``dist.exports[groupname][name]``
+   ``dist.exports[groupname][name]``
 
 ``get_entry_map(distname, groupname=None)``
-    ``dist.exports`` or ``dist.exports[groupname]``
+   ``dist.exports`` or ``dist.exports[groupname]``
 
 ``iter_entry_points(groupname, name=None)``
-    ``dist_path.get_exported_entries(groupname, name=None)``
+   ``dist_path.get_exported_entries(groupname, name=None)``

File docs/tutorial.rst

 
 .. currentmodule:: distlib.database
 
-    You can use the ``distlib.database`` package to access information about
-    installed distributions. This information is available through the
-    following classes:
+   You can use the ``distlib.database`` package to access information about
+   installed distributions. This information is available through the
+   following classes:
 
-    * :class:`DistributionPath`, which represents a set of distributions installed
-      on a path.
-    * :class:`Distribution`, which represents an individual distribution,
-      conforming to recent packaging PEPs (:pep:`386`, :pep:`376`, :pep:`345`,
-      :pep:`314` and :pep:`241`).
-    * :class:`EggInfoDistribution`, which represents a legacy distribution in
-      egg format.
+   * :class:`DistributionPath`, which represents a set of distributions installed
+     on a path.
+   * :class:`Distribution`, which represents an individual distribution,
+     conforming to recent packaging PEPs (:pep:`386`, :pep:`376`, :pep:`345`,
+     :pep:`314` and :pep:`241`).
+   * :class:`EggInfoDistribution`, which represents a legacy distribution in
+     egg format.
 
 Distribution paths
 ~~~~~~~~~~~~~~~~~~
 
 .. currentmodule:: distlib.scripts
 
-You can use the ``distlib.scripts`` API to install scripts. Installing scripts
-is slightly more involved than just copying files:
+   You can use the ``distlib.scripts`` API to install scripts. Installing scripts
+   is slightly more involved than just copying files:
 
-* You may need to adjust shebang lines in scripts to point to the interpreter
-  that will be used to run scripts. This is important in virtual environments
-  (venvs), and also in other situations where you may have multiple Python
-  installations on a single computer.
-* On Windows or on systems where the :pep:`397` launcher isn't installed, it is
-  not easy to ensure that the correct Python interpreter is used for a script.
-  You may wish to install native Windows executable launchers which run the
-  correct interpreter, based on a shebang line in the script.
+    * You may need to adjust shebang lines in scripts to point to the interpreter
+      that will be used to run scripts. This is important in virtual environments
+      (venvs), and also in other situations where you may have multiple Python
+      installations on a single computer.
+    * On Windows or on systems where the :pep:`397` launcher isn't installed, it is
+      not easy to ensure that the correct Python interpreter is used for a script.
+      You may wish to install native Windows executable launchers which run the
+      correct interpreter, based on a shebang line in the script.
 
-Specifying scripts to install
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+   Specifying scripts to install
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-To install scripts, create a :class:`ScriptMaker` instance,
-giving it the source and target directories for scripts::
+   To install scripts, create a :class:`ScriptMaker` instance,
+   giving it the source and target directories for scripts::
 
     >>> from distlib.scripts import ScriptMaker
     >>> maker = ScriptMaker(source_dir, target_dir)
     >>>
 
-You can then install a script ``foo.py`` like this::
+   You can then install a script ``foo.py`` like this::
 
     >>> maker.make('foo.py')
     >>>
 
-The string passed to make can take one of the following forms:
+   The string passed to make can take one of the following forms:
 
-* A filename, relative to the source directory for scripts, such as ``foo.py``
-  or ``subdir/bar.py``.
-* A reference to a callable, given in the form::
+   * A filename, relative to the source directory for scripts, such as ``foo.py``
+     or ``subdir/bar.py``.
+   * A reference to a callable, given in the form::
 
     name = some_package.some_module:some_callable [flags]
 
-  where the *flags* part is optional. The only flag currently in use is
-  ``'gui'``, which indicates on Windows that a Windows executable launcher
-  (rather than a launcher which is a console application) should be used.
-  (this only applies if ``add_launchers`` is true)
+   where the *flags* part is optional. The only flag currently in use is
+   ``'gui'``, which indicates on Windows that a Windows executable launcher
+   (rather than a launcher which is a console application) should be used.
+   (this only applies if ``add_launchers`` is true)
 
-  For more information about flags, see :ref:`flag-formats`.
+   For more information about flags, see :ref:`flag-formats`.
 
-  Note that this format is exactly the same as for export entries in a
-  distribution (see :ref:`dist-exports`).
+   Note that this format is exactly the same as for export entries in a
+   distribution (see :ref:`dist-exports`).
 
-  When this form is passed to the :meth:`ScriptMaker.make`
-  method, a Python stub script is created with the appropriate shebang line
-  and with code to load and call the specified callable with no arguments,
-  returning its value as the return code from the script.
+   When this form is passed to the :meth:`ScriptMaker.make`
+   method, a Python stub script is created with the appropriate shebang line
+   and with code to load and call the specified callable with no arguments,
+   returning its value as the return code from the script.
 
-Wrapping callables with scripts
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+   Wrapping callables with scripts
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-Let's see how wrapping a callable works. Consider the following file::
+   Let's see how wrapping a callable works. Consider the following file::
 
     $ cat scripts/foo.py
     def main():
     def other_main():
         print('Hello again from foo')
 
-we can try wrapping ``main`` and ``other_main`` as callables::
+   we can try wrapping ``main`` and ``other_main`` as callables::
 
     >>> from distlib.scripts import ScriptMaker
     >>> maker = ScriptMaker('scripts', '/tmp/scratch')
     ['/tmp/scratch/foo', '/tmp/scratch/bar']
     >>>
 
-we can inspect the resulting scripts. First, ``foo``::
+   we can inspect the resulting scripts. First, ``foo``::
 
     $ ls /tmp/scratch/
     bar  foo
 
 .. currentmodule:: distlib.version
 
-    Overview
-    ~~~~~~~~
+   Overview
+   ~~~~~~~~
 
-    The :class:`NormalizedVersion` class implements a :pep:`386` compatible
-    version::
+   The :class:`NormalizedVersion` class implements a :pep:`386` compatible
+   version::
 
-        >>> from distlib.version import NormalizedVersion
-        >>> v1 = NormalizedVersion('1.0')
-        >>> v2 = NormalizedVersion('1.0a1')
-        >>> v3 = NormalizedVersion('1.0b1')
-        >>> v4 = NormalizedVersion('1.0c1')
-        >>> v5 = NormalizedVersion('1.0.post1')
-        >>>
+    >>> from distlib.version import NormalizedVersion
+    >>> v1 = NormalizedVersion('1.0')
+    >>> v2 = NormalizedVersion('1.0a1')
+    >>> v3 = NormalizedVersion('1.0b1')
+    >>> v4 = NormalizedVersion('1.0c1')
+    >>> v5 = NormalizedVersion('1.0.post1')
+    >>>
 
-    These sort in the expected order::
+   These sort in the expected order::
 
-        >>> v2 < v3 < v4 < v1 < v5
-        True
-        >>>
+    >>> v2 < v3 < v4 < v1 < v5
+    True
+    >>>
 
-    You can't pass any old thing as a version number::
+   You can't pass any old thing as a version number::
 
-        >>> NormalizedVersion('foo')
-        Traceback (most recent call last):
-          File "<stdin>", line 1, in <module>
-          File "distlib/version.py", line 49, in __init__
-            self._parts = parts = self.parse(s)
-          File "distlib/version.py", line 254, in parse
-            def parse(self, s): return normalized_key(s)
-          File "distlib/version.py", line 199, in normalized_key
-            raise UnsupportedVersionError(s)
-        distlib.version.UnsupportedVersionError: foo
-        >>>
+    >>> NormalizedVersion('foo')
+    Traceback (most recent call last):
+    File "<stdin>", line 1, in <module>
+    File "distlib/version.py", line 49, in __init__
+      self._parts = parts = self.parse(s)
+    File "distlib/version.py", line 254, in parse
+      def parse(self, s): return normalized_key(s)
+    File "distlib/version.py", line 199, in normalized_key
+      raise UnsupportedVersionError(s)
+    distlib.version.UnsupportedVersionError: foo
+    >>>
 
-    Matching versions against constraints
-    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+   Matching versions against constraints
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-    The :class:`NormalizedMatcher` is used to match version constraints against
-    versions::
+   The :class:`NormalizedMatcher` is used to match version constraints against
+   versions::
 
-        >>> from distlib.version import NormalizedMatcher
-        >>> m = NormalizedMatcher('foo (1.0b1)')
-        >>> m
-        NormalizedMatcher('foo (1.0b1)')
-        >>> [m.match(v) for v in v1, v2, v3, v4, v5]
-        [False, False, True, False, False]
-        >>>
+    >>> from distlib.version import NormalizedMatcher
+    >>> m = NormalizedMatcher('foo (1.0b1)')
+    >>> m
+    NormalizedMatcher('foo (1.0b1)')
+    >>> [m.match(v) for v in v1, v2, v3, v4, v5]
+    [False, False, True, False, False]
+    >>>
 
-    Specifying ``'foo (1.0b1)'`` is equivalent to specifying ``'foo (==1.0b1)'``,
-    i.e. only the exact version is matched. You can also specify inequality
-    constraints::
+   Specifying ``'foo (1.0b1)'`` is equivalent to specifying ``'foo (==1.0b1)'``,
+   i.e. only the exact version is matched. You can also specify inequality
+   constraints::
 
-        >>> m = NormalizedMatcher('foo (<1.0c1)')
-        >>> [m.match(v) for v in v1, v2, v3, v4, v5]
-        [False, True, True, False, False]
-        >>>
+    >>> m = NormalizedMatcher('foo (<1.0c1)')
+    >>> [m.match(v) for v in v1, v2, v3, v4, v5]
+    [False, True, True, False, False]
+    >>>
 
-    and multiple constraints::
+   and multiple constraints::
 
-        >>> m = NormalizedMatcher('foo (>= 1.0b1, <1.0.post1)')
-        >>> [m.match(v) for v in v1, v2, v3, v4, v5]
-        [True, False, True, True, False]
-        >>>
+    >>> m = NormalizedMatcher('foo (>= 1.0b1, <1.0.post1)')
+    >>> [m.match(v) for v in v1, v2, v3, v4, v5]
+    [True, False, True, True, False]
+    >>>
 
-    You can do exactly the same thing as above with ``setuptools``/
-    ``distribute`` version numbering (use ``LegacyVersion`` and ``LegacyMatcher``)
-    or with semantic versioning (use ``SemanticVersion`` and ``SemanticMatcher``).
-    However, you can't mix and match versions of different types::
+   You can do exactly the same thing as above with ``setuptools``/
+   ``distribute`` version numbering (use ``LegacyVersion`` and ``LegacyMatcher``)
+   or with semantic versioning (use ``SemanticVersion`` and ``SemanticMatcher``).
+   However, you can't mix and match versions of different types::
 
-        >>> from distlib.version import SemanticVersion, LegacyVersion
-        >>> nv = NormalizedVersion('1.0.0')
-        >>> lv = LegacyVersion('1.0.0')
-        >>> sv = SemanticVersion('1.0.0')
-        >>> lv == sv
-        Traceback (most recent call last):
-          File "<stdin>", line 1, in <module>
-          File "distlib/version.py", line 61, in __eq__
-            self._check_compatible(other)
-          File "distlib/version.py", line 58, in _check_compatible
-            raise TypeError('cannot compare %r and %r' % (self, other))
-        TypeError: cannot compare LegacyVersion('1.0.0') and SemanticVersion('1.0.0')
-        >>> nv == sv
-        Traceback (most recent call last):
-          File "<stdin>", line 1, in <module>
-          File "distlib/version.py", line 61, in __eq__
-            self._check_compatible(other)
-          File "distlib/version.py", line 58, in _check_compatible
-            raise TypeError('cannot compare %r and %r' % (self, other))
-        TypeError: cannot compare NormalizedVersion('1.0.0') and SemanticVersion('1.0.0')
-        >>>
+    >>> from distlib.version import SemanticVersion, LegacyVersion
+    >>> nv = NormalizedVersion('1.0.0')
+    >>> lv = LegacyVersion('1.0.0')
+    >>> sv = SemanticVersion('1.0.0')
+    >>> lv == sv
+    Traceback (most recent call last):
+    File "<stdin>", line 1, in <module>
+    File "distlib/version.py", line 61, in __eq__
+      self._check_compatible(other)
+    File "distlib/version.py", line 58, in _check_compatible
+      raise TypeError('cannot compare %r and %r' % (self, other))
+    TypeError: cannot compare LegacyVersion('1.0.0') and SemanticVersion('1.0.0')
+    >>> nv == sv
+    Traceback (most recent call last):
+    File "<stdin>", line 1, in <module>
+    File "distlib/version.py", line 61, in __eq__
+      self._check_compatible(other)
+    File "distlib/version.py", line 58, in _check_compatible
+      raise TypeError('cannot compare %r and %r' % (self, other))
+    TypeError: cannot compare NormalizedVersion('1.0.0') and SemanticVersion('1.0.0')
+    >>>
 
 Using the locators API
 ^^^^^^^^^^^^^^^^^^^^^^
 
 .. currentmodule:: distlib.locators
 
-    Overview
-    ~~~~~~~~
+   Overview
+   ~~~~~~~~
 
-    To locate a distribution in an index, we can use the :func:`locate` function.
-    This returns a potentially downloadable distribution (in the sense that it
-    has a download URL - of course, there are no guarantees that there will
-    actually be a downloadable resource at that URL). The return value is an
-    instance of :class:`distlib.database.Distribution` which can be queried for
-    any distributions it requires, so that they can be located if desired.
-    Here is a basic example::
+   To locate a distribution in an index, we can use the :func:`locate` function.
+   This returns a potentially downloadable distribution (in the sense that it
+   has a download URL - of course, there are no guarantees that there will
+   actually be a downloadable resource at that URL). The return value is an
+   instance of :class:`distlib.database.Distribution` which can be queried for
+   any distributions it requires, so that they can be located if desired.
+   Here is a basic example::
 
-        >>> from distlib.locators import locate
-        >>> flask = locate('flask')
-        >>> flask
-        <Distribution Flask (0.9) [http://pypi.python.org/packages/source/F/Flask/Flask-0.9.tar.gz]>
-        >>> dependencies = [locate(r) for r in flask.get_requirements('install')]
-        >>> from pprint import pprint
-        >>> pprint(dependencies)
-        [<Distribution Werkzeug (0.8.3) [http://pypi.python.org/packages/source/W/Werkzeug/Werkzeug-0.8.3.tar.gz]>,
-         <Distribution Jinja2 (2.6) [http://pypi.python.org/packages/source/J/Jinja2/Jinja2-2.6.tar.gz]>]
-        >>>
+    >>> from distlib.locators import locate
+    >>> flask = locate('flask')
+    >>> flask
+    <Distribution Flask (0.9) [http://pypi.python.org/packages/source/F/Flask/Flask-0.9.tar.gz]>
+    >>> dependencies = [locate(r) for r in flask.get_requirements('install')]
+    >>> from pprint import pprint
+    >>> pprint(dependencies)
+    [<Distribution Werkzeug (0.8.3) [http://pypi.python.org/packages/source/W/Werkzeug/Werkzeug-0.8.3.tar.gz]>,
+    <Distribution Jinja2 (2.6) [http://pypi.python.org/packages/source/J/Jinja2/Jinja2-2.6.tar.gz]>]
+    >>>
 
-    The values returned by :meth:`get_requirements` are just strings. Here's another
-    example, showing a little more detail::
+   The values returned by :meth:`get_requirements` are just strings. Here's another
+   example, showing a little more detail::
 
-        >>> authy = locate('authy')
-        >>> authy.get_requirements('install')
-        [u'httplib2 (>= 0.7, < 0.8)', u'simplejson']
-        >>> authy
-        <Distribution authy (0.0.4) [http://pypi.python.org/packages/source/a/authy/authy-0.0.4.tar.gz]>
-        >>> deps = [locate(r) for r in authy.get_requirements('install')]
-        >>> pprint(deps)
-        [<Distribution httplib2 (0.7.6) [http://pypi.python.org/packages/source/h/httplib2/httplib2-0.7.6.tar.gz]>,
-         <Distribution simplejson (2.6.2) [http://pypi.python.org/packages/source/s/simplejson/simplejson-2.6.2.tar.gz]>]
-        >>>
+    >>> authy = locate('authy')
+    >>> authy.get_requirements('install')
+    [u'httplib2 (>= 0.7, < 0.8)', u'simplejson']
+    >>> authy
+    <Distribution authy (0.0.4) [http://pypi.python.org/packages/source/a/authy/authy-0.0.4.tar.gz]>
+    >>> deps = [locate(r) for r in authy.get_requirements('install')]
+    >>> pprint(deps)
+    [<Distribution httplib2 (0.7.6) [http://pypi.python.org/packages/source/h/httplib2/httplib2-0.7.6.tar.gz]>,
+    <Distribution simplejson (2.6.2) [http://pypi.python.org/packages/source/s/simplejson/simplejson-2.6.2.tar.gz]>]
+    >>>
 
-    Note that the constraints on the dependencies were honoured by :func:`locate`.
+   Note that the constraints on the dependencies were honoured by :func:`locate`.
 
-    Under the hood
-    ~~~~~~~~~~~~~~
+   Under the hood
+   ~~~~~~~~~~~~~~
 
-    Under the hood, :func:`locate` uses *locators*. Locators are a mechanism for
-    finding distributions from a range of sources. Although the ``pypi`` subpackage
-    has been copied from ``distutils2`` to ``distlib``, there may be benefits in a
-    higher-level API, and so the ``distlib.locators`` package has been created as
-    an experiment. Locators are objects which locate distributions. A locators
-    instance's :meth:`get_project` method is called, passing in a project name: The
-    method returns a dictionary containing information about distribution releases
-    found for that project. The keys of the returned dictionary are versions, and
-    the values are instances of :class:`distlib.database.Distribution`.
+   Under the hood, :func:`locate` uses *locators*. Locators are a mechanism for
+   finding distributions from a range of sources. Although the ``pypi`` subpackage
+   has been copied from ``distutils2`` to ``distlib``, there may be benefits in a
+   higher-level API, and so the ``distlib.locators`` package has been created as
+   an experiment. Locators are objects which locate distributions. A locators
+   instance's :meth:`get_project` method is called, passing in a project name: The
+   method returns a dictionary containing information about distribution releases
+   found for that project. The keys of the returned dictionary are versions, and
+   the values are instances of :class:`distlib.database.Distribution`.
 
-    The following locators are provided:
+   The following locators are provided:
 
-    * :class:`DirectoryLocator` -- this is instantiated with a base directory and
-      will look for archives in the file system tree under that directory. Name
-      and version information is inferred from the filenames of archives and the
-      amount of information returned about the download is minimal.
-    * :class:`PyPIRPCLocator`. -- This takes a base URL for the RPC service and
-      will locate packages using PyPI's XML-RPC API. This locator is a little slow
-      (the scraping interface seems to work faster) and case-sensitive. For
-      example, searching for ``'flask'`` will throw up no results, but you get the
-      expected results when searching for ``'Flask'``. This appears to be a
-      limitation of the underlying XML-RPC API. Note that 20 versions of a
-      project necessitate 41 network calls (one to get the versions and
-      two more for each version -- one to get the metadata, and another to get the
-      downloads information).
-    * :class:`PyPIJSONLocator`. -- This takes a base URL for the JSON service and
-      will locate packages using PyPI's JSON API. This locator is case-sensitive. For
-      example, searching for ``'flask'`` will throw up no results, but you get the
-      expected results when searching for ``'Flask'``. This appears to be a
-      limitation of the underlying JSON API. Note that unlike the XML-RPC service,
-      only non-hidden releases will be returned.
-    * :class:`SimpleScrapingLocator` -- this takes a base URL for the site to
-      scrape, and locates packages using a similar approach to the
-      ``PackageFinder`` class in ``pip``, or as documented in ``setuptools``
-      as the approach used by ``easy_install``.
-    * :class:`DistPathLocator` -- this takes a :class:`DistributionPath` instance
-      and locates installed distributions. This can be used with
-      :class:`AggregatingLocator` to satisfy requirements from installed
-      distributions before looking elsewhere for them.
-    * :class:`AggregatingLocator` -- this takes a list of other aggregators and
-      delegates finding projects to them. It can either return the first result
-      found (i.e. from the first aggregator in the list provided which returns a
-      non-empty result) or a merged result from all the aggregators in the list.
+   * :class:`DirectoryLocator` -- this is instantiated with a base directory and
+     will look for archives in the file system tree under that directory. Name
+     and version information is inferred from the filenames of archives and the
+     amount of information returned about the download is minimal.
+   * :class:`PyPIRPCLocator`. -- This takes a base URL for the RPC service and
+     will locate packages using PyPI's XML-RPC API. This locator is a little slow
+     (the scraping interface seems to work faster) and case-sensitive. For
+     example, searching for ``'flask'`` will throw up no results, but you get the
+     expected results when searching for ``'Flask'``. This appears to be a
+     limitation of the underlying XML-RPC API. Note that 20 versions of a
+     project necessitate 41 network calls (one to get the versions and
+     two more for each version -- one to get the metadata, and another to get the
+     downloads information).
+   * :class:`PyPIJSONLocator`. -- This takes a base URL for the JSON service and
+     will locate packages using PyPI's JSON API. This locator is case-sensitive. For
+     example, searching for ``'flask'`` will throw up no results, but you get the
+     expected results when searching for ``'Flask'``. This appears to be a
+     limitation of the underlying JSON API. Note that unlike the XML-RPC service,
+     only non-hidden releases will be returned.
+   * :class:`SimpleScrapingLocator` -- this takes a base URL for the site to
+     scrape, and locates packages using a similar approach to the
+     ``PackageFinder`` class in ``pip``, or as documented in ``setuptools``
+     as the approach used by ``easy_install``.
+   * :class:`DistPathLocator` -- this takes a :class:`DistributionPath` instance
+     and locates installed distributions. This can be used with
+     :class:`AggregatingLocator` to satisfy requirements from installed
+     distributions before looking elsewhere for them.
+   * :class:`AggregatingLocator` -- this takes a list of other aggregators and
+     delegates finding projects to them. It can either return the first result
+     found (i.e. from the first aggregator in the list provided which returns a
+     non-empty result) or a merged result from all the aggregators in the list.
 
-    There is a default locator, available at :attr:`distlib.locators.default_locator`.
+   There is a default locator, available at :attr:`distlib.locators.default_locator`.
 
-    An example of usage of locator instances is given below::
+   An example of usage of locator instances is given below::
 
-        >>> from distlib.locators import SimpleScrapingLocator
-        >>> from pprint import pprint
-        >>> locator = SimpleScrapingLocator('http://pypi.python.org/simple/')
-        >>> result = locator.get_project('python-gnupg')
-        >>> pprint(result)
-        {u'0.2.3': <Distribution python-gnupg (0.2.3) [http://python-gnupg.googlecode.com/files/python-gnupg-0.2.3.tar.gz]>,
-         u'0.2.4': <Distribution python-gnupg (0.2.4) [http://python-gnupg.googlecode.com/files/python-gnupg-0.2.4.tar.gz]>,
-         u'0.2.9': <Distribution python-gnupg (0.2.9) [http://python-gnupg.googlecode.com/files/python-gnupg-0.2.9.tar.gz]>,
-         u'0.3.0': <Distribution python-gnupg (0.3.0) [http://python-gnupg.googlecode.com/files/python-gnupg-0.3.0.tar.gz]>,
-         u'0.3.1': <Distribution python-gnupg (0.3.1) [http://python-gnupg.googlecode.com/files/python-gnupg-0.3.1.tar.gz]>}
-        >>>
+    >>> from distlib.locators import SimpleScrapingLocator
+    >>> from pprint import pprint
+    >>> locator = SimpleScrapingLocator('http://pypi.python.org/simple/')
+    >>> result = locator.get_project('python-gnupg')
+    >>> pprint(result)
+    {u'0.2.3': <Distribution python-gnupg (0.2.3) [http://python-gnupg.googlecode.com/files/python-gnupg-0.2.3.tar.gz]>,
+     u'0.2.4': <Distribution python-gnupg (0.2.4) [http://python-gnupg.googlecode.com/files/python-gnupg-0.2.4.tar.gz]>,
+     u'0.2.9': <Distribution python-gnupg (0.2.9) [http://python-gnupg.googlecode.com/files/python-gnupg-0.2.9.tar.gz]>,
+     u'0.3.0': <Distribution python-gnupg (0.3.0) [http://python-gnupg.googlecode.com/files/python-gnupg-0.3.0.tar.gz]>,
+     u'0.3.1': <Distribution python-gnupg (0.3.1) [http://python-gnupg.googlecode.com/files/python-gnupg-0.3.1.tar.gz]>}
+     >>>
 
-    Now the same project, using the XML-RPC API::
+   Now the same project, using the XML-RPC API::
 
-        >>> from distlib.locators import PyPIRPCLocator
-        >>> locator = PyPIRPCLocator('http://python.org/pypi')
-        >>> result = locator.get_project('python-gnupg')
-        >>> pprint(result)
-        {'0.2.3': <Distribution python-gnupg (0.2.3) [http://python-gnupg.googlecode.com/files/python-gnupg-0.2.3.tar.gz]>,
-         '0.2.4': <Distribution python-gnupg (0.2.4) [http://python-gnupg.googlecode.com/files/python-gnupg-0.2.4.tar.gz]>,
-         '0.2.6': <Distribution python-gnupg (0.2.6) [UNKNOWN]>,
-         '0.2.7': <Distribution python-gnupg (0.2.7) [UNKNOWN]>,
-         '0.2.8': <Distribution python-gnupg (0.2.8) [UNKNOWN]>,
-         '0.2.9': <Distribution python-gnupg (0.2.9) [http://python-gnupg.googlecode.com/files/python-gnupg-0.2.9.tar.gz]>,
-         '0.3.0': <Distribution python-gnupg (0.3.0) [http://python-gnupg.googlecode.com/files/python-gnupg-0.3.0.tar.gz]>,
-         '0.3.1': <Distribution python-gnupg (0.3.1) [http://python-gnupg.googlecode.com/files/python-gnupg-0.3.1.tar.gz]>}
-        >>>
+    >>> from distlib.locators import PyPIRPCLocator
+    >>> locator = PyPIRPCLocator('http://python.org/pypi')
+    >>> result = locator.get_project('python-gnupg')
+    >>> pprint(result)
+    {'0.2.3': <Distribution python-gnupg (0.2.3) [http://python-gnupg.googlecode.com/files/python-gnupg-0.2.3.tar.gz]>,
+    '0.2.4': <Distribution python-gnupg (0.2.4) [http://python-gnupg.googlecode.com/files/python-gnupg-0.2.4.tar.gz]>,
+    '0.2.6': <Distribution python-gnupg (0.2.6) [UNKNOWN]>,
+    '0.2.7': <Distribution python-gnupg (0.2.7) [UNKNOWN]>,
+    '0.2.8': <Distribution python-gnupg (0.2.8) [UNKNOWN]>,
+    '0.2.9': <Distribution python-gnupg (0.2.9) [http://python-gnupg.googlecode.com/files/python-gnupg-0.2.9.tar.gz]>,
+    '0.3.0': <Distribution python-gnupg (0.3.0) [http://python-gnupg.googlecode.com/files/python-gnupg-0.3.0.tar.gz]>,
+    '0.3.1': <Distribution python-gnupg (0.3.1) [http://python-gnupg.googlecode.com/files/python-gnupg-0.3.1.tar.gz]>}
+    >>>
 
-    .. note::
-        The reason why some of the download URLs come up as UNKNOWN is that some of
-        the PyPI metadata is incomplete.
+   .. note::
+      The reason why some of the download URLs come up as UNKNOWN is that some of
+      the PyPI metadata is incomplete.
 
-    Locators also have a method, :meth:`get_distribution_names`, which returns a
-    set of all the distribution names known to that locator instance. Note that
-    the base :class:`Locator` and :class:`JSONLocator` classes don't implement this
-    method, so they will raise a :class:`NotImplementedError`.
+   Locators also have a method, :meth:`get_distribution_names`, which returns a
+   set of all the distribution names known to that locator instance. Note that
+   the base :class:`Locator` and :class:`JSONLocator` classes don't implement this
+   method, so they will raise a :class:`NotImplementedError`.
 
-    The ``locators`` package also contains a function,
-    :func:`get_all_distribution_names`, which retrieves the names of all
-    distributions registered on PyPI::
+   The ``locators`` package also contains a function,
+   :func:`get_all_distribution_names`, which retrieves the names of all
+   distributions registered on PyPI::
 
-        >>> from distlib.locators import get_all_distribution_names
-        >>> names = get_all_package_names()
-        >>> len(names)
-        24801
-        >>>
+    >>> from distlib.locators import get_all_distribution_names
+    >>> names = get_all_package_names()
+    >>> len(names)
+    24801
+    >>>
 
-    This is implemented using the XML-RPC API.
+   This is implemented using the XML-RPC API.
 
-    The Locator API is very bare-bones at the moment, but additional features will
-    be added in due course. A very bare-bones command-line script which exercises
-    these locators is to be found `here <https://gist.github.com/3886402>`_, and
-    feedback will be gratefully received from anyone who tries it out.
+   The Locator API is very bare-bones at the moment, but additional features will
+   be added in due course. A very bare-bones command-line script which exercises
+   these locators is to be found `here <https://gist.github.com/3886402>`_, and
+   feedback will be gratefully received from anyone who tries it out.
 
-    None of the locators currently returns enough metadata to allow dependency
-    resolution to be carried out, but that is a result of the fact that metadata
-    relating to dependencies are not indexed, and would require not just downloading
-    the distribution archives and inspection of contained metadata files, but
-    potentially also introspecting setup.py! This is the downside of having vital
-    information only available via keyword arguments to the :func:`setup` call:
-    hopefully, a move to fully declarative metadata will facilitate indexing it and
-    allowing the provision of features currently provided by ``setuptools`` (e.g.
-    hints for downloads -- ``'dependency _links'``).
+   None of the locators currently returns enough metadata to allow dependency
+   resolution to be carried out, but that is a result of the fact that metadata
+   relating to dependencies are not indexed, and would require not just downloading
+   the distribution archives and inspection of contained metadata files, but
+   potentially also introspecting setup.py! This is the downside of having vital
+   information only available via keyword arguments to the :func:`setup` call:
+   hopefully, a move to fully declarative metadata will facilitate indexing it and
+   allowing the provision of features currently provided by ``setuptools`` (e.g.
+   hints for downloads -- ``'dependency _links'``).
 
-    The locators will skip binary distributions (``.egg`` files are currently
-    treated as binary distributions).
+   The locators will skip binary distributions (``.egg`` files are currently
+   treated as binary distributions).
 
-    The PyPI locator classes don't yet support the use of mirrors, but that can be
-    added in due course -- once the basic functionality is working satisfactorily.
+   The PyPI locator classes don't yet support the use of mirrors, but that can be
+   added in due course -- once the basic functionality is working satisfactorily.
 
 Next steps
 ----------

File docs/util.rst

 
 .. function:: get_platform()
 
-    Return a string that identifies the current platform. This is used mainly to
-    distinguish platform-specific build directories and platform-specific built
-    distributions. Typically includes the OS name and version and the
-    architecture (as supplied by 'os.uname()'), although the exact information
-    included depends on the OS; e.g. for IRIX the architecture isn't particularly
-    important (IRIX only runs on SGI hardware), but for Linux the kernel version
-    isn't particularly important.
+   Return a string that identifies the current platform. This is used mainly to
+   distinguish platform-specific build directories and platform-specific built
+   distributions. Typically includes the OS name and version and the
+   architecture (as supplied by 'os.uname()'), although the exact information
+   included depends on the OS; e.g. for IRIX the architecture isn't particularly
+   important (IRIX only runs on SGI hardware), but for Linux the kernel version
+   isn't particularly important.
 
-    Examples of returned values:
+   Examples of returned values:
 
-    * ``linux-i586``
-    * ``linux-alpha``
-    * ``solaris-2.6-sun4u``
-    * ``irix-5.3``
-    * ``irix64-6.2``
+   * ``linux-i586``
+   * ``linux-alpha``
+   * ``solaris-2.6-sun4u``
+   * ``irix-5.3``
+   * ``irix64-6.2``
 
-    For non-POSIX platforms, currently just returns ``sys.platform``.
+   For non-POSIX platforms, currently just returns ``sys.platform``.
 
-    For Mac OS X systems the OS version reflects the minimal version on which
-    binaries will run (that is, the value of ``MACOSX_DEPLOYMENT_TARGET``
-    during the build of Python), not the OS version of the current system.
+   For Mac OS X systems the OS version reflects the minimal version on which
+   binaries will run (that is, the value of ``MACOSX_DEPLOYMENT_TARGET``
+   during the build of Python), not the OS version of the current system.
 
-    For universal binary builds on Mac OS X the architecture value reflects
-    the universal binary status instead of the architecture of the current
-    processor. For 32-bit universal binaries the architecture is ``fat``,
-    for 64-bit universal binaries the architecture is ``fat64``, and
-    for 4-way universal binaries the architecture is ``universal``. Starting
-    from Python 2.7 and Python 3.2 the architecture ``fat3`` is used for
-    a 3-way universal build (ppc, i386, x86_64) and ``intel`` is used for
-    a universal build with the i386 and x86_64 architectures
+   For universal binary builds on Mac OS X the architecture value reflects
+   the universal binary status instead of the architecture of the current
+   processor. For 32-bit universal binaries the architecture is ``fat``,
+   for 64-bit universal binaries the architecture is ``fat64``, and
+   for 4-way universal binaries the architecture is ``universal``. Starting
+   from Python 2.7 and Python 3.2 the architecture ``fat3`` is used for
+   a 3-way universal build (ppc, i386, x86_64) and ``intel`` is used for
+   a universal build with the i386 and x86_64 architectures
 
-    Examples of returned values on Mac OS X:
+   Examples of returned values on Mac OS X:
 
-    * ``macosx-10.3-ppc``
+   * ``macosx-10.3-ppc``
+   * ``macosx-10.3-fat``
+   * ``macosx-10.5-universal``
+   * ``macosx-10.6-intel``
 
-    * ``macosx-10.3-fat``
-
-    * ``macosx-10.5-universal``
-
-    * ``macosx-10.6-intel``
-
-    .. XXX reinvention of platform module?
+   .. XXX reinvention of platform module?
 
 .. function:: convert_path(pathname)
 
-    Return 'pathname' as a name that will work on the native filesystem, i.e.
-    split it on '/' and put it back together again using the current directory
-    separator. Needed because filenames in the setup script are always supplied
-    in Unix style, and have to be converted to the local convention before we
-    can actually use them in the filesystem.  Raises :exc:`ValueError` on
-    non-Unix-ish systems if *pathname* either starts or ends with a slash.
+   Return 'pathname' as a name that will work on the native filesystem, i.e.
+   split it on '/' and put it back together again using the current directory
+   separator. Needed because filenames in the setup script are always supplied
+   in Unix style, and have to be converted to the local convention before we
+   can actually use them in the filesystem.  Raises :exc:`ValueError` on
+   non-Unix-ish systems if *pathname* either starts or ends with a slash.
 
 .. function:: change_root(new_root, pathname)
 
-    Return *pathname* with *new_root* prepended.  If *pathname* is relative, this
-    is equivalent to ``os.path.join(new_root,pathname)`` Otherwise, it requires
-    making *pathname* relative and then joining the two, which is tricky on
-    DOS/Windows.
+   Return *pathname* with *new_root* prepended.  If *pathname* is relative, this
+   is equivalent to ``os.path.join(new_root,pathname)`` Otherwise, it requires
+   making *pathname* relative and then joining the two, which is tricky on
+   DOS/Windows.
 
 .. function:: check_environ()
 
-    Ensure that 'os.environ' has all the environment variables we guarantee that
-    users can use in config files, command-line options, etc.  Currently this
-    includes:
+   Ensure that 'os.environ' has all the environment variables we guarantee that
+   users can use in config files, command-line options, etc.  Currently this
+   includes:
 
-    * :envvar:`HOME` - user's home directory (Unix only)
-    * :envvar:`PLAT` - description of the current platform, including hardware
+   * :envvar:`HOME` - user's home directory (Unix only)
+   * :envvar:`PLAT` - description of the current platform, including hardware
      and OS (see :func:`get_platform`)
 
 .. function:: find_executable(executable, path=None)
 
-    Search the path for a given executable name.
+   Search the path for a given executable name.
 
 .. function:: execute(func, args, msg=None, dry_run=False)
 
-    Perform some action that affects the outside world (for instance, writing to
-    the filesystem). Such actions are special because they are disabled by the
-    *dry_run* flag. This method takes care of all that bureaucracy for you,
-    all you have to do is supply the function to call, an argument tuple
-    (to embody the "external action" being performed), and an optional message
-    to print.
+   Perform some action that affects the outside world (for instance, writing to
+   the filesystem). Such actions are special because they are disabled by the
+   *dry_run* flag. This method takes care of all that bureaucracy for you,
+   all you have to do is supply the function to call, an argument tuple
+   (to embody the "external action" being performed), and an optional message
+   to print.
 
 .. function:: newer(source, target)
 
-    Return true if *source* exists and is more recently modified than *target*
-    or if *source* exists and *target* doesn't. Return false if both exist and
-    *target* is the same age or newer than *source*. Raise
-    :exc:`PackagingFileError` if *source* does not exist.
+   Return true if *source* exists and is more recently modified than *target*
+   or if *source* exists and *target* doesn't. Return false if both exist and
+   *target* is the same age or newer than *source*. Raise
+   :exc:`PackagingFileError` if *source* does not exist.
 
 .. function:: strtobool(val)
 
-    Convert a string representation of truth to true (1) or false (0).
+   Convert a string representation of truth to true (1) or false (0).
 
-    True values are ``y``, ``yes``, ``t``, ``true``, ``on`` and ``1``; false
-    values are ``n``, ``no``, ``f``, ``false``, ``off`` and ``0``.  Raises
-    :exc:`ValueError` if *val* is anything else.
+   True values are ``y``, ``yes``, ``t``, ``true``, ``on`` and ``1``; false
+   values are ``n``, ``no``, ``f``, ``false``, ``off`` and ``0``.  Raises
+   :exc:`ValueError` if *val* is anything else.
 
 
 .. function:: byte_compile(py_files, optimize=0, force=0, prefix=None, \
                            base_dir=None, dry_run=0, direct=None)
 
-    Byte-compile a collection of Python source files to either :file:`.pyc` or
-    :file:`.pyo` files in a :file:`__pycache__` subdirectory (see :pep:`3147`),
-    or to the same directory when using the distutils2 backport on Python
-    versions older than 3.2.
+   Byte-compile a collection of Python source files to either :file:`.pyc` or
+   :file:`.pyo` files in a :file:`__pycache__` subdirectory (see :pep:`3147`),
+   or to the same directory when using the distutils2 backport on Python
+   versions older than 3.2.
 
-    *py_files* is a list of files to compile, any files that don't end in
-    :file:`.py` are silently skipped. *optimize* must be one of the following:
+   *py_files* is a list of files to compile, any files that don't end in
+   :file:`.py` are silently skipped. *optimize* must be one of the following:
 
-    * ``0`` - don't optimize (generate :file:`.pyc`)
-    * ``1`` - normal optimization (like ``python -O``)
-    * ``2`` - extra optimization (like ``python -OO``)
+   * ``0`` - don't optimize (generate :file:`.pyc`)
+   * ``1`` - normal optimization (like ``python -O``)
+   * ``2`` - extra optimization (like ``python -OO``)
 
-    This function is independent from the running Python's :option:`-O` or
-    :option:`-B` options, it is fully controlled by the parameters passed in.
+   This function is independent from the running Python's :option:`-O` or
+   :option:`-B` options, it is fully controlled by the parameters passed in.
 
-    If *force* is true, all files are recompiled regardless of timestamps.
+   If *force* is true, all files are recompiled regardless of timestamps.
 
-    The source filename encoded in each :term:`bytecode` file defaults to the
-    filenames listed in *py_files*, you can modify these with *prefix* and
-    *basedir*. *prefix* is a string that will be stripped off of each source
-    filename, and *base_dir* is a directory name that will be prepended (after
-    *prefix* is stripped). You can supply either or both (or neither) of
-    *prefix* and *base_dir*, as you wish.
+   The source filename encoded in each :term:`bytecode` file defaults to the
+   filenames listed in *py_files*, you can modify these with *prefix* and
+   *basedir*. *prefix* is a string that will be stripped off of each source
+   filename, and *base_dir* is a directory name that will be prepended (after
+   *prefix* is stripped). You can supply either or both (or neither) of
+   *prefix* and *base_dir*, as you wish.
 
-    If *dry_run* is true, it doesn't actually do anything that would affect the
-    filesystem.
+   If *dry_run* is true, it doesn't actually do anything that would affect the
+   filesystem.
 
-    Byte-compilation is either done directly in the interpreter process with the
-    standard :mod:`py_compile` module, or indirectly by writing a temporary
-    script and executing it.  Normally, you should let :func:`byte_compile`
-    figure out whether to use direct compilation or not (see the source for
-    details). The *direct* flag is used by the script generated in indirect
-    mode, unless you know what you're doing, leave it set to ``None``.
+   Byte-compilation is either done directly in the interpreter process with the
+   standard :mod:`py_compile` module, or indirectly by writing a temporary
+   script and executing it.  Normally, you should let :func:`byte_compile`
+   figure out whether to use direct compilation or not (see the source for
+   details). The *direct* flag is used by the script generated in indirect
+   mode, unless you know what you're doing, leave it set to ``None``.

File docs/version.rst

 
 .. class:: NormalizedVersion(self, s, error_on_huge_major_num=True)
 
-    A specific version of a distribution, as described in PEP 345. *s* is a
-    string object containing the version number (for example ``'1.2b1'``),
-    *error_on_huge_major_num* a boolean specifying whether to consider an
-    apparent use of a year or full date as the major version number an error.
+   A specific version of a distribution, as described in PEP 345. *s* is a
+   string object containing the version number (for example ``'1.2b1'``),
+   *error_on_huge_major_num* a boolean specifying whether to consider an
+   apparent use of a year or full date as the major version number an error.
 
-    The rationale for the second argument is that there were projects using
-    years or full dates as version numbers, which could cause problems with some
-    packaging systems sorting.
+   The rationale for the second argument is that there were projects using
+   years or full dates as version numbers, which could cause problems with some
+   packaging systems sorting.
 
-    Instances of this class can be compared and sorted::
+   Instances of this class can be compared and sorted::
 
-        >>> NormalizedVersion('1.2b1') < NormalizedVersion('1.2')
-        True
-        >>>
+    >>> NormalizedVersion('1.2b1') < NormalizedVersion('1.2')
+    True
+    >>>
 
-    :class:`NormalizedVersion` is used internally by :class:`VersionPredicate`
-    to do its work.
+   :class:`NormalizedVersion` is used internally by :class:`VersionPredicate`
+   to do its work.
 
 .. class:: IrrationalVersionError
 
-    Exception raised when an invalid string is given to
-    :class:`NormalizedVersion`::
+   Exception raised when an invalid string is given to
+   :class:`NormalizedVersion`::
 
-        >>> NormalizedVersion("irrational_version_number")
-        IrrationalVersionError: irrational_version_number
-        >>>
+    >>> NormalizedVersion("irrational_version_number")
+    IrrationalVersionError: irrational_version_number
+    >>>
 
 .. function:: suggest_normalized_version(s)
 
-    Before standardization in PEP 386, various schemes were in use. Packaging
-    provides a function to try to convert any string to a valid, normalized
-    version::
+   Before standardization in PEP 386, various schemes were in use. Packaging
+   provides a function to try to convert any string to a valid, normalized
+   version::
 
-        >>> suggest_normalized_version('2.1-rc1')
-        2.1c1
-        >>>
+    >>> suggest_normalized_version('2.1-rc1')
+    2.1c1
+    >>>
 
-    If :func:`suggest_normalized_version` can't make sense of the given string,
-    it will return ``None``::
+   If :func:`suggest_normalized_version` can't make sense of the given string,
+   it will return ``None``::
 
-        >>> print(suggest_normalized_version('not a version'))
-        None
-        >>
+    >>> print(suggest_normalized_version('not a version'))
+    None
+    >>
 
 Version predicates
 ------------------
 
 .. class:: VersionPredicate(predicate)
 
-    This class deals with the parsing of field values like
-    ``ProjectName (>=version)``.
+   This class deals with the parsing of field values like
+   ``ProjectName (>=version)``.
 
-    .. method:: match(version)
+   .. method:: match(version)
 
-        Test if a version number matches the predicate::
+      Test if a version number matches the predicate::
 
-             >>> version = VersionPredicate("ProjectName (<1.2, >1.0)")
-             >>> version.match("1.2.1")
-             False
-             >>> version.match("1.1.1")
-             True
-             >>>
+    >>> version = VersionPredicate("ProjectName (<1.2, >1.0)")
+    >>> version.match("1.2.1")
+    False
+    >>> version.match("1.1.1")
+    True
+    >>>
 
 Validation helpers
 ------------------
 
 .. function:: is_valid_version(predicate)
 
-    Check whether the given string is a valid version number.  Example of valid
-    strings: ``'1.2'``,  ``'4.2.0.dev4'``, ``'2.5.4.post2'``.
+   Check whether the given string is a valid version number.  Example of valid
+   strings: ``'1.2'``,  ``'4.2.0.dev4'``, ``'2.5.4.post2'``.
 
 .. function:: is_valid_versions(predicate)
 
-    Check whether the given string is a valid value for specifying multiple
-    versions, such as in the Requires-Python field.  Example: ``'2.7, >=3.2'``.
+   Check whether the given string is a valid value for specifying multiple
+   versions, such as in the Requires-Python field.  Example: ``'2.7, >=3.2'``.
 
 .. function:: is_valid_predicate(predicate)
 
-    Check whether the given string is a valid version predicate.  Examples:
-    ``'some.project == 4.5, <= 4.7'``, ``'speciallib (> 1.0, != 1.4.2, < 2.0)'``.
+   Check whether the given string is a valid version predicate.  Examples:
+   ``'some.project == 4.5, <= 4.7'``, ``'speciallib (> 1.0, != 1.4.2, < 2.0)'``.