Ignore:
Timestamp:
Mar 19, 2014, 11:31:01 PM (11 years ago)
Author:
dmik
Message:

python: Merge vendor 2.7.6 to trunk.

Location:
python/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • python/trunk

  • python/trunk/Doc/distutils/apiref.rst

    r2 r391  
    2222
    2323   The basic do-everything function that does most everything you could ever ask
    24    for from a Distutils method. See XXXXX
     24   for from a Distutils method.
    2525
    2626   The setup function takes a large number of arguments. These are laid out in the
    2727   following table.
     28
     29   .. tabularcolumns:: |l|L|L|
    2830
    2931   +--------------------+--------------------------------+-------------------------------------------------------------+
     
    3234   | *name*             | The name of the package        | a string                                                    |
    3335   +--------------------+--------------------------------+-------------------------------------------------------------+
    34    | *version*          | The version number of the      | See :mod:`distutils.version`                                |
    35    |                    | package                        |                                                             |
     36   | *version*          | The version number of the      | a string                                                    |
     37   |                    | package; see                   |                                                             |
     38   |                    | :mod:`distutils.version`       |                                                             |
    3639   +--------------------+--------------------------------+-------------------------------------------------------------+
    3740   | *description*      | A single line describing the   | a string                                                    |
     
    4851   | *maintainer*       | The name of the current        | a string                                                    |
    4952   |                    | maintainer, if different from  |                                                             |
    50    |                    | the author                     |                                                             |
    51    +--------------------+--------------------------------+-------------------------------------------------------------+
    52    | *maintainer_email* | The email address of the       |                                                             |
     53   |                    | the author. Note that if       |                                                             |
     54   |                    | the maintainer is provided,    |                                                             |
     55   |                    | distutils will use it as the   |                                                             |
     56   |                    | author in :file:`PKG-INFO`     |                                                             |
     57   +--------------------+--------------------------------+-------------------------------------------------------------+
     58   | *maintainer_email* | The email address of the       | a string                                                    |
    5359   |                    | current maintainer, if         |                                                             |
    5460   |                    | different from the author      |                                                             |
    5561   +--------------------+--------------------------------+-------------------------------------------------------------+
    56    | *url*              | A URL for the package          | a URL                                                       |
     62   | *url*              | A URL for the package          | a string                                                    |
    5763   |                    | (homepage)                     |                                                             |
    5864   +--------------------+--------------------------------+-------------------------------------------------------------+
    59    | *download_url*     | A URL to download the package  | a URL                                                       |
     65   | *download_url*     | A URL to download the package  | a string                                                    |
    6066   +--------------------+--------------------------------+-------------------------------------------------------------+
    6167   | *packages*         | A list of Python packages that | a list of strings                                           |
     
    6975   |                    | installed                      |                                                             |
    7076   +--------------------+--------------------------------+-------------------------------------------------------------+
    71    | *ext_modules*      | A list of Python extensions to | A list of  instances of                                     |
     77   | *ext_modules*      | A list of Python extensions to | a list of instances of                                      |
    7278   |                    | be built                       | :class:`distutils.core.Extension`                           |
    7379   +--------------------+--------------------------------+-------------------------------------------------------------+
    74    | *classifiers*      | A list of categories for the   | The list of available                                       |
    75    |                    | package                        | categorizations is at                                       |
    76    |                    |                                | http://pypi.python.org/pypi?:action=list_classifiers.       |
    77    +--------------------+--------------------------------+-------------------------------------------------------------+
    78    | *distclass*        | the :class:`Distribution`      | A subclass of                                               |
     80   | *classifiers*      | A list of categories for the   | a list of strings; valid classifiers are listed on `PyPI    |
     81   |                    | package                        | <http://pypi.python.org/pypi?:action=list_classifiers>`_.   |
     82   +--------------------+--------------------------------+-------------------------------------------------------------+
     83   | *distclass*        | the :class:`Distribution`      | a subclass of                                               |
    7984   |                    | class to use                   | :class:`distutils.core.Distribution`                        |
    8085   +--------------------+--------------------------------+-------------------------------------------------------------+
     
    8691   |                    | setup script                   |                                                             |
    8792   +--------------------+--------------------------------+-------------------------------------------------------------+
    88    | *options*          | default options for the setup  | a string                                                    |
     93   | *options*          | default options for the setup  | a dictionary                                                |
    8994   |                    | script                         |                                                             |
    9095   +--------------------+--------------------------------+-------------------------------------------------------------+
    9196   | *license*          | The license for the package    | a string                                                    |
    9297   +--------------------+--------------------------------+-------------------------------------------------------------+
    93    | *keywords*         | Descriptive meta-data, see     |                                                             |
     98   | *keywords*         | Descriptive meta-data, see     | a list of strings or a comma-separated string               |
    9499   |                    | :pep:`314`                     |                                                             |
    95100   +--------------------+--------------------------------+-------------------------------------------------------------+
    96    | *platforms*        |                                |                                                             |
     101   | *platforms*        |                                | a list of strings or a comma-separated string               |
    97102   +--------------------+--------------------------------+-------------------------------------------------------------+
    98103   | *cmdclass*         | A mapping of command names to  | a dictionary                                                |
     
    122127
    123128   *stop_after* tells :func:`setup` when to stop processing; possible  values:
     129
     130   .. tabularcolumns:: |l|L|
    124131
    125132   +---------------+---------------------------------------------+
     
    148155live elsewhere.
    149156
    150 * :class:`Extension` from :mod:`distutils.extension`
    151 
    152 * :class:`Command` from :mod:`distutils.cmd`
    153 
    154 * :class:`Distribution` from :mod:`distutils.dist`
     157* :class:`~distutils.extension.Extension` from :mod:`distutils.extension`
     158
     159* :class:`~distutils.cmd.Command` from :mod:`distutils.cmd`
     160
     161* :class:`~distutils.dist.Distribution` from :mod:`distutils.dist`
    155162
    156163A short description of each of these follows, but see the relevant module for
     
    162169   The Extension class describes a single C or C++extension module in a setup
    163170   script. It accepts the following keyword arguments in its constructor
     171
     172   .. tabularcolumns:: |l|L|l|
    164173
    165174   +------------------------+--------------------------------+---------------------------+
    166175   | argument name          | value                          | type                      |
    167176   +========================+================================+===========================+
    168    | *name*                 | the full name of the           | string                    |
     177   | *name*                 | the full name of the           | a string                  |
    169178   |                        | extension, including any       |                           |
    170179   |                        | packages --- ie. *not* a       |                           |
     
    172181   |                        | Python dotted name             |                           |
    173182   +------------------------+--------------------------------+---------------------------+
    174    | *sources*              | list of source filenames,      | string                    |
     183   | *sources*              | list of source filenames,      | a list of strings         |
    175184   |                        | relative to the distribution   |                           |
    176185   |                        | root (where the setup script   |                           |
     
    185194   |                        | extension.                     |                           |
    186195   +------------------------+--------------------------------+---------------------------+
    187    | *include_dirs*         | list of directories to search  | string                    |
     196   | *include_dirs*         | list of directories to search  | a list of strings         |
    188197   |                        | for C/C++ header files (in     |                           |
    189198   |                        | Unix form for portability)     |                           |
    190199   +------------------------+--------------------------------+---------------------------+
    191    | *define_macros*        | list of macros to define; each | (string, string) tuple or |
    192    |                        | macro is defined using a       | (name, ``None``)          |
     200   | *define_macros*        | list of macros to define; each | a list of tuples          |
     201   |                        | macro is defined using a       |                           |
    193202   |                        | 2-tuple ``(name, value)``,     |                           |
    194203   |                        | where *value* is               |                           |
     
    201210   |                        | line)                          |                           |
    202211   +------------------------+--------------------------------+---------------------------+
    203    | *undef_macros*         | list of macros to undefine     | string                    |
     212   | *undef_macros*         | list of macros to undefine     | a list of strings         |
    204213   |                        | explicitly                     |                           |
    205214   +------------------------+--------------------------------+---------------------------+
    206    | *library_dirs*         | list of directories to search  | string                    |
     215   | *library_dirs*         | list of directories to search  | a list of strings         |
    207216   |                        | for C/C++ libraries at link    |                           |
    208217   |                        | time                           |                           |
    209218   +------------------------+--------------------------------+---------------------------+
    210    | *libraries*            | list of library names (not     | string                    |
     219   | *libraries*            | list of library names (not     | a list of strings         |
    211220   |                        | filenames or paths) to link    |                           |
    212221   |                        | against                        |                           |
    213222   +------------------------+--------------------------------+---------------------------+
    214    | *runtime_library_dirs* | list of directories to search  | string                    |
     223   | *runtime_library_dirs* | list of directories to search  | a list of strings         |
    215224   |                        | for C/C++ libraries at run     |                           |
    216225   |                        | time (for shared extensions,   |                           |
     
    218227   |                        | loaded)                        |                           |
    219228   +------------------------+--------------------------------+---------------------------+
    220    | *extra_objects*        | list of extra files to link    | string                    |
     229   | *extra_objects*        | list of extra files to link    | a list of strings         |
    221230   |                        | with (eg. object files not     |                           |
    222231   |                        | implied by 'sources', static   |                           |
     
    225234   |                        | resource files, etc.)          |                           |
    226235   +------------------------+--------------------------------+---------------------------+
    227    | *extra_compile_args*   | any extra platform- and        | string                    |
     236   | *extra_compile_args*   | any extra platform- and        | a list of strings         |
    228237   |                        | compiler-specific information  |                           |
    229238   |                        | to use when compiling the      |                           |
     
    236245   |                        | be anything.                   |                           |
    237246   +------------------------+--------------------------------+---------------------------+
    238    | *extra_link_args*      | any extra platform- and        | string                    |
     247   | *extra_link_args*      | any extra platform- and        | a list of strings         |
    239248   |                        | compiler-specific information  |                           |
    240249   |                        | to use when linking object     |                           |
     
    245254   |                        | 'extra_compile_args'.          |                           |
    246255   +------------------------+--------------------------------+---------------------------+
    247    | *export_symbols*       | list of symbols to be exported | string                    |
     256   | *export_symbols*       | list of symbols to be exported | a list of strings         |
    248257   |                        | from a shared extension. Not   |                           |
    249258   |                        | used on all platforms, and not |                           |
     
    253262   |                        | ``init`` + extension_name.     |                           |
    254263   +------------------------+--------------------------------+---------------------------+
    255    | *depends*              | list of files that the         | string                    |
     264   | *depends*              | list of files that the         | a list of strings         |
    256265   |                        | extension depends on           |                           |
    257266   +------------------------+--------------------------------+---------------------------+
    258    | *language*             | extension language (i.e.       | string                    |
     267   | *language*             | extension language (i.e.       | a string                  |
    259268   |                        | ``'c'``, ``'c++'``,            |                           |
    260269   |                        | ``'objc'``). Will be detected  |                           |
     
    445454      The optional parameter *value* should be a string; if it is not supplied, then
    446455      the macro will be defined without an explicit value and the exact outcome
    447       depends on the compiler used (XXX true? does ANSI say anything about this?)
     456      depends on the compiler used.
     457
     458      .. XXX true? does ANSI say anything about this?
    448459
    449460
     
    599610      *output_libname* should be a library name, not a filename; the filename will be
    600611      inferred from the library name.  *output_dir* is the directory where the library
    601       file will be put. XXX defaults to what?
     612      file will be put.
     613
     614      .. XXX defaults to what?
    602615
    603616      *debug* is a boolean; if true, debugging information will be included in the
     
    717730   .. method:: CCompiler.execute(func, args[, msg=None, level=1])
    718731
    719       Invokes :func:`distutils.util.execute` This method invokes a  Python function
     732      Invokes :func:`distutils.util.execute`. This method invokes a  Python function
    720733      *func* with the given arguments *args*, after  logging and taking into account
    721       the *dry_run* flag. XXX see also.
     734      the *dry_run* flag.
    722735
    723736
     
    725738
    726739      Invokes :func:`distutils.util.spawn`. This invokes an external  process to run
    727       the given command. XXX see also.
     740      the given command.
    728741
    729742
     
    731744
    732745      Invokes :func:`distutils.dir_util.mkpath`. This creates a directory  and any
    733       missing ancestor directories. XXX see also.
     746      missing ancestor directories.
    734747
    735748
    736749   .. method:: CCompiler.move_file(src, dst)
    737750
    738       Invokes :meth:`distutils.file_util.move_file`. Renames *src* to  *dst*.  XXX see
    739       also.
     751      Invokes :meth:`distutils.file_util.move_file`. Renames *src* to  *dst*.
    740752
    741753
    742754   .. method:: CCompiler.announce(msg[, level=1])
    743755
    744       Write a message using :func:`distutils.log.debug`. XXX see also.
     756      Write a message using :func:`distutils.log.debug`.
    745757
    746758
     
    846858This module provides the EMXCCompiler class, a subclass of
    847859:class:`UnixCCompiler` that handles the EMX port of the GNU C compiler to OS/2.
    848 
    849 
    850 :mod:`distutils.mwerkscompiler` --- Metrowerks CodeWarrior support
    851 ==================================================================
    852 
    853 .. module:: distutils.mwerkscompiler
    854    :synopsis: Metrowerks CodeWarrior support
    855 
    856 
    857 Contains :class:`MWerksCompiler`, an implementation of the abstract
    858 :class:`CCompiler` class for MetroWerks CodeWarrior on the pre-Mac OS X
    859 Macintosh. Needs work to support CW on Windows or Mac OS X.
    860 
    861 .. % \subsection{Utility modules}
    862 .. %
    863 .. % The following modules all provide general utility functions. They haven't
    864 .. % all been documented yet.
    865860
    866861
     
    887882   both default to the current directory.  Returns the name of the archive file.
    888883
    889    .. XXX This should be changed to support bz2 files.
    890 
    891884
    892885.. function:: make_tarball(base_name, base_dir[, compress='gzip', verbose=0, dry_run=0])
     
    900893   or :file:`.Z`).  Return the output filename.
    901894
    902    .. XXX This should be replaced with calls to the :mod:`tarfile` module.
    903 
    904895
    905896.. function:: make_zipfile(base_name, base_dir[, verbose=0, dry_run=0])
    906897
    907898   Create a zip file from all files in and under *base_dir*.  The output zip file
    908    will be named *base_dir* + :file:`.zip`.  Uses either the  :mod:`zipfile` Python
     899   will be named *base_name* + :file:`.zip`.  Uses either the  :mod:`zipfile` Python
    909900   module (if available) or the InfoZIP :file:`zip`  utility (if installed and
    910901   found on the default search path).  If neither  tool is available, raises
     
    992983   *dst* must be directory names.  If *src* is not a directory, raise
    993984   :exc:`DistutilsFileError`.  If *dst* does  not exist, it is created with
    994    :func:`mkpath`.  The end result of the  copy is that every file in *src* is
    995    copied to *dst*, and  directories under *src* are recursively copied to *dst*.
     985   :func:`mkpath`.  The end result of the copy is that every file in *src* is
     986   copied to *dst*, and directories under *src* are recursively copied to *dst*.
    996987   Return the list of files that were copied or might have been copied, using their
    997988   output name. The return value is unaffected by *update* or *dry_run*: it is
     
    999990   *dst*.
    1000991
    1001    *preserve_mode* and *preserve_times* are the same as for :func:`copy_file` in
    1002    :mod:`distutils.file_util`; note that they only apply to regular files, not to
     992   *preserve_mode* and *preserve_times* are the same as for
     993   :func:`distutils.file_util.copy_file`; note that they only apply to
     994   regular files, not to
    1003995   directories.  If *preserve_symlinks* is true, symlinks will be copied as
    1004996   symlinks (on platforms that support them!); otherwise (the default), the
     
    1006998   as for :func:`copy_file`.
    1007999
     1000   Files in *src* that begin with :file:`.nfs` are skipped (more information on
     1001   these files is available in answer D2 of the `NFS FAQ page
     1002   <http://nfs.sourceforge.net/#section_d>`_.
     1003
     1004   .. versionchanged:: 2.7.4
     1005      NFS files are ignored.
     1006
    10081007
    10091008.. function:: remove_tree(directory[, verbose=0, dry_run=0])
     
    10121011   errors are ignored (apart from being reported to ``sys.stdout`` if *verbose* is
    10131012   true).
    1014 
    1015 **\*\*** Some of this could be replaced with the shutil module? **\*\***
    10161013
    10171014
     
    11281125   * ``macosx-10.6-intel``
    11291126
    1130    .. % XXX isn't this also provided by some other non-distutils module?
    1131 
    11321127
    11331128.. function:: convert_path(pathname)
     
    11791174   and does what it can to deal with  exception objects that don't have a filename
    11801175   (which happens when the error  is due to a two-file operation, such as
    1181    :func:`rename` or  :func:`link`).  Returns the error message as a string
    1182    prefixed  with *prefix*.
     1176   :func:`~os.rename` or  :func:`~os.link`).  Returns the error message as a
     1177   string prefixed  with *prefix*.
    11831178
    11841179
     
    12641259
    12651260
    1266 This module provides the :class:`Distribution` class, which represents the
    1267 module distribution being built/installed/distributed.
     1261This module provides the :class:`~distutils.core.Distribution` class, which
     1262represents the module distribution being built/installed/distributed.
    12681263
    12691264
     
    13281323  the "negative alias" of :option:`--verbose`, then :option:`--quiet` on the
    13291324  command line sets *verbose* to false.
    1330 
    1331 **\*\*** Should be replaced with :mod:`optik` (which is also now known as
    1332 :mod:`optparse` in Python 2.3 and later). **\*\***
    13331325
    13341326
     
    13481340   Wraps *text* to less than *width* wide.
    13491341
    1350    .. XXX Should be replaced with :mod:`textwrap` (which is available in Python
    1351       2.3 and later).
    13521342
    13531343
     
    14111401.. module:: distutils.log
    14121402   :synopsis: A simple logging mechanism, 282-style
    1413 
    1414 
    1415 .. XXX Should be replaced with standard :mod:`logging` module.
    1416 
    14171403
    14181404
     
    15771563
    15781564   The options are all boolean, and affect the values returned by :meth:`readline`
     1565
     1566   .. tabularcolumns:: |l|L|l|
    15791567
    15801568   +------------------+--------------------------------+---------+
     
    16981686
    16991687.. module:: distutils.cmd
    1700    :synopsis: This module provides the abstract base class Command. This class is subclassed
    1701               by the modules in the distutils.command subpackage.
     1688   :synopsis: This module provides the abstract base class Command. This class
     1689              is subclassed by the modules in the distutils.command subpackage.
    17021690
    17031691
     
    17091697   Abstract base class for defining command classes, the "worker bees" of the
    17101698   Distutils.  A useful analogy for command classes is to think of them as
    1711    subroutines with local variables called *options*.  The options are declared in
    1712    :meth:`initialize_options` and defined (given their final values) in
    1713    :meth:`finalize_options`, both of which must be defined by every command class.
    1714    The distinction between the two is necessary because option values might come
    1715    from the outside world (command line, config file, ...), and any options
    1716    dependent on other options must be computed after these outside influences have
    1717    been processed --- hence :meth:`finalize_options`.  The body of the subroutine,
    1718    where it does all its work based on the values of its options, is the
    1719    :meth:`run` method, which must also be implemented by every command class.
    1720 
    1721    The class constructor takes a single argument *dist*, a  :class:`Distribution`
    1722    instance.
    1723 
    1724 
    1725 :mod:`distutils.command` --- Individual Distutils commands
    1726 ==========================================================
    1727 
    1728 .. module:: distutils.command
    1729    :synopsis: This subpackage contains one module for each standard Distutils command.
    1730 
    1731 
    1732 .. % \subsubsection{Individual Distutils commands}
    1733 .. % todo
    1734 
    1735 
    1736 :mod:`distutils.command.bdist` --- Build a binary installer
    1737 ===========================================================
    1738 
    1739 .. module:: distutils.command.bdist
    1740    :synopsis: Build a binary installer for a package
    1741 
    1742 
    1743 .. % todo
    1744 
    1745 
    1746 :mod:`distutils.command.bdist_packager` --- Abstract base class for packagers
    1747 =============================================================================
    1748 
    1749 .. module:: distutils.command.bdist_packager
    1750    :synopsis: Abstract base class for packagers
    1751 
    1752 
    1753 .. % todo
    1754 
    1755 
    1756 :mod:`distutils.command.bdist_dumb` --- Build a "dumb" installer
    1757 ================================================================
    1758 
    1759 .. module:: distutils.command.bdist_dumb
    1760    :synopsis: Build a "dumb" installer - a simple archive of files
    1761 
    1762 
    1763 .. % todo
    1764 
    1765 
    1766 :mod:`distutils.command.bdist_msi` --- Build a Microsoft Installer binary package
    1767 =================================================================================
    1768 
    1769 .. module:: distutils.command.bdist_msi
    1770    :synopsis: Build a binary distribution as a Windows MSI file
    1771 
    1772 .. class:: bdist_msi(Command)
    1773 
    1774    Builds a `Windows Installer`_ (.msi) binary package.
    1775 
    1776    .. _Windows Installer: http://msdn.microsoft.com/en-us/library/cc185688(VS.85).aspx
    1777 
    1778    In most cases, the ``bdist_msi`` installer is a better choice than the
    1779    ``bdist_wininst`` installer, because it provides better support for
    1780    Win64 platforms, allows administrators to perform non-interactive
    1781    installations, and allows installation through group policies.
    1782 
    1783 
    1784 :mod:`distutils.command.bdist_rpm` --- Build a binary distribution as a Redhat RPM and SRPM
    1785 ===========================================================================================
    1786 
    1787 .. module:: distutils.command.bdist_rpm
    1788    :synopsis: Build a binary distribution as a Redhat RPM and SRPM
    1789 
    1790 
    1791 .. % todo
    1792 
    1793 
    1794 :mod:`distutils.command.bdist_wininst` --- Build a Windows installer
    1795 ====================================================================
    1796 
    1797 .. module:: distutils.command.bdist_wininst
    1798    :synopsis: Build a Windows installer
    1799 
    1800 
    1801 .. % todo
    1802 
    1803 
    1804 :mod:`distutils.command.sdist` --- Build a source distribution
    1805 ==============================================================
    1806 
    1807 .. module:: distutils.command.sdist
    1808    :synopsis: Build a source distribution
    1809 
    1810 
    1811 .. % todo
    1812 
    1813 
    1814 :mod:`distutils.command.build` --- Build all files of a package
    1815 ===============================================================
    1816 
    1817 .. module:: distutils.command.build
    1818    :synopsis: Build all files of a package
    1819 
    1820 
    1821 .. % todo
    1822 
    1823 
    1824 :mod:`distutils.command.build_clib` --- Build any C libraries in a package
    1825 ==========================================================================
    1826 
    1827 .. module:: distutils.command.build_clib
    1828    :synopsis: Build any C libraries in a package
    1829 
    1830 
    1831 .. % todo
    1832 
    1833 
    1834 :mod:`distutils.command.build_ext` --- Build any extensions in a package
    1835 ========================================================================
    1836 
    1837 .. module:: distutils.command.build_ext
    1838    :synopsis: Build any extensions in a package
    1839 
    1840 
    1841 .. % todo
    1842 
    1843 
    1844 :mod:`distutils.command.build_py` --- Build the .py/.pyc files of a package
    1845 ===========================================================================
    1846 
    1847 .. module:: distutils.command.build_py
    1848    :synopsis: Build the .py/.pyc files of a package
    1849 
    1850 
    1851 .. % todo
    1852 
    1853 
    1854 :mod:`distutils.command.build_scripts` --- Build the scripts of a package
    1855 =========================================================================
    1856 
    1857 .. module:: distutils.command.build_scripts
    1858    :synopsis: Build the scripts of a package
    1859 
    1860 
    1861 .. % todo
    1862 
    1863 
    1864 :mod:`distutils.command.clean` --- Clean a package build area
    1865 =============================================================
    1866 
    1867 .. module:: distutils.command.clean
    1868    :synopsis: Clean a package build area
    1869 
    1870 
    1871 .. % todo
    1872 
    1873 
    1874 :mod:`distutils.command.config` --- Perform package configuration
    1875 =================================================================
    1876 
    1877 .. module:: distutils.command.config
    1878    :synopsis: Perform package configuration
    1879 
    1880 
    1881 .. % todo
    1882 
    1883 
    1884 :mod:`distutils.command.install` --- Install a package
    1885 ======================================================
    1886 
    1887 .. module:: distutils.command.install
    1888    :synopsis: Install a package
    1889 
    1890 
    1891 .. % todo
    1892 
    1893 
    1894 :mod:`distutils.command.install_data` --- Install data files from a package
    1895 ===========================================================================
    1896 
    1897 .. module:: distutils.command.install_data
    1898    :synopsis: Install data files from a package
    1899 
    1900 
    1901 .. % todo
    1902 
    1903 
    1904 :mod:`distutils.command.install_headers` --- Install C/C++ header files from a package
    1905 ======================================================================================
    1906 
    1907 .. module:: distutils.command.install_headers
    1908    :synopsis: Install C/C++ header files from a package
    1909 
    1910 
    1911 .. % todo
    1912 
    1913 
    1914 :mod:`distutils.command.install_lib` --- Install library files from a package
    1915 =============================================================================
    1916 
    1917 .. module:: distutils.command.install_lib
    1918    :synopsis: Install library files from a package
    1919 
    1920 
    1921 .. % todo
    1922 
    1923 
    1924 :mod:`distutils.command.install_scripts` --- Install script files from a package
    1925 ================================================================================
    1926 
    1927 .. module:: distutils.command.install_scripts
    1928    :synopsis: Install script files from a package
    1929 
    1930 
    1931 .. % todo
    1932 
    1933 
    1934 :mod:`distutils.command.register` --- Register a module with the Python Package Index
    1935 =====================================================================================
    1936 
    1937 .. module:: distutils.command.register
    1938    :synopsis: Register a module with the Python Package Index
    1939 
    1940 
    1941 The ``register`` command registers the package with the Python Package  Index.
    1942 This is described in more detail in :pep:`301`.
    1943 
    1944 .. % todo
     1699   subroutines with local variables called *options*.  The options are declared
     1700   in :meth:`initialize_options` and defined (given their final values) in
     1701   :meth:`finalize_options`, both of which must be defined by every command
     1702   class.  The distinction between the two is necessary because option values
     1703   might come from the outside world (command line, config file, ...), and any
     1704   options dependent on other options must be computed after these outside
     1705   influences have been processed --- hence :meth:`finalize_options`.  The body
     1706   of the subroutine, where it does all its work based on the values of its
     1707   options, is the :meth:`run` method, which must also be implemented by every
     1708   command class.
     1709
     1710   The class constructor takes a single argument *dist*, a
     1711   :class:`~distutils.core.Distribution` instance.
    19451712
    19461713
     
    19511718
    19521719A new command lives in a module in the :mod:`distutils.command` package. There
    1953 is a sample template in that directory called  :file:`command_template`. Copy
     1720is a sample template in that directory called :file:`command_template`. Copy
    19541721this file to a new module with the same name as the new command you're
    1955 implementing. This module should implement a class with the same name as the
    1956 module (and the command). So, for instance, to create the command
     1722implementing.  This module should implement a class with the same name as the
     1723module (and the command).  So, for instance, to create the command
    19571724``peel_banana`` (so that users can run ``setup.py peel_banana``), you'd copy
    1958 :file:`command_template`  to :file:`distutils/command/peel_banana.py`, then edit
     1725:file:`command_template` to :file:`distutils/command/peel_banana.py`, then edit
    19591726it so that it's implementing the class :class:`peel_banana`, a subclass of
    19601727:class:`distutils.cmd.Command`.
    19611728
    19621729Subclasses of :class:`Command` must define the following methods.
    1963 
    19641730
    19651731.. method:: Command.initialize_options()
     
    19771743   always called as late as possible, ie.  after any option assignments from the
    19781744   command-line or from other commands have been done.  Thus, this is the place
    1979    to to code option dependencies: if *foo* depends on *bar*, then it is safe to
     1745   to code option dependencies: if *foo* depends on *bar*, then it is safe to
    19801746   set *foo* from *bar* as long as *foo* still has the same value it was
    19811747   assigned in :meth:`initialize_options`.
     
    19901756   be done by :meth:`run`.
    19911757
    1992 *sub_commands* formalizes the notion of a "family" of commands, eg. ``install``
    1993 as the parent with sub-commands ``install_lib``, ``install_headers``, etc.  The
    1994 parent of a family of commands defines *sub_commands* as a class attribute; it's
    1995 a list of 2-tuples ``(command_name, predicate)``, with *command_name* a string
    1996 and *predicate* an unbound method, a string or None. *predicate* is a method of
    1997 the parent command that determines whether the corresponding command is
    1998 applicable in the current situation.  (Eg. we ``install_headers`` is only
    1999 applicable if we have any C header files to install.)  If *predicate* is None,
    2000 that command is always applicable.
    2001 
    2002 *sub_commands* is usually defined at the \*end\* of a class, because predicates
    2003 can be unbound methods, so they must already have been defined.  The canonical
    2004 example is the :command:`install` command.
     1758
     1759.. attribute:: Command.sub_commands
     1760
     1761   *sub_commands* formalizes the notion of a "family" of commands,
     1762   e.g. ``install`` as the parent with sub-commands ``install_lib``,
     1763   ``install_headers``, etc.  The parent of a family of commands defines
     1764   *sub_commands* as a class attribute; it's a list of 2-tuples ``(command_name,
     1765   predicate)``, with *command_name* a string and *predicate* a function, a
     1766   string or ``None``.  *predicate* is a method of the parent command that
     1767   determines whether the corresponding command is applicable in the current
     1768   situation.  (E.g. ``install_headers`` is only applicable if we have any C
     1769   header files to install.)  If *predicate* is ``None``, that command is always
     1770   applicable.
     1771
     1772   *sub_commands* is usually defined at the *end* of a class, because
     1773   predicates can be methods of the class, so they must already have been
     1774   defined.  The canonical example is the :command:`install` command.
     1775
     1776
     1777:mod:`distutils.command` --- Individual Distutils commands
     1778==========================================================
     1779
     1780.. module:: distutils.command
     1781   :synopsis: This subpackage contains one module for each standard Distutils command.
     1782
     1783
     1784.. % \subsubsection{Individual Distutils commands}
     1785.. % todo
     1786
     1787
     1788:mod:`distutils.command.bdist` --- Build a binary installer
     1789===========================================================
     1790
     1791.. module:: distutils.command.bdist
     1792   :synopsis: Build a binary installer for a package
     1793
     1794
     1795.. % todo
     1796
     1797
     1798:mod:`distutils.command.bdist_packager` --- Abstract base class for packagers
     1799=============================================================================
     1800
     1801.. module:: distutils.command.bdist_packager
     1802   :synopsis: Abstract base class for packagers
     1803
     1804
     1805.. % todo
     1806
     1807
     1808:mod:`distutils.command.bdist_dumb` --- Build a "dumb" installer
     1809================================================================
     1810
     1811.. module:: distutils.command.bdist_dumb
     1812   :synopsis: Build a "dumb" installer - a simple archive of files
     1813
     1814
     1815.. % todo
     1816
     1817
     1818:mod:`distutils.command.bdist_msi` --- Build a Microsoft Installer binary package
     1819=================================================================================
     1820
     1821.. module:: distutils.command.bdist_msi
     1822   :synopsis: Build a binary distribution as a Windows MSI file
     1823
     1824.. class:: bdist_msi
     1825
     1826   Builds a `Windows Installer`_ (.msi) binary package.
     1827
     1828   .. _Windows Installer: http://msdn.microsoft.com/en-us/library/cc185688(VS.85).aspx
     1829
     1830   In most cases, the ``bdist_msi`` installer is a better choice than the
     1831   ``bdist_wininst`` installer, because it provides better support for
     1832   Win64 platforms, allows administrators to perform non-interactive
     1833   installations, and allows installation through group policies.
     1834
     1835
     1836:mod:`distutils.command.bdist_rpm` --- Build a binary distribution as a Redhat RPM and SRPM
     1837===========================================================================================
     1838
     1839.. module:: distutils.command.bdist_rpm
     1840   :synopsis: Build a binary distribution as a Redhat RPM and SRPM
     1841
     1842
     1843.. % todo
     1844
     1845
     1846:mod:`distutils.command.bdist_wininst` --- Build a Windows installer
     1847====================================================================
     1848
     1849.. module:: distutils.command.bdist_wininst
     1850   :synopsis: Build a Windows installer
     1851
     1852
     1853.. % todo
     1854
     1855
     1856:mod:`distutils.command.sdist` --- Build a source distribution
     1857==============================================================
     1858
     1859.. module:: distutils.command.sdist
     1860   :synopsis: Build a source distribution
     1861
     1862
     1863.. % todo
     1864
     1865
     1866:mod:`distutils.command.build` --- Build all files of a package
     1867===============================================================
     1868
     1869.. module:: distutils.command.build
     1870   :synopsis: Build all files of a package
     1871
     1872
     1873.. % todo
     1874
     1875
     1876:mod:`distutils.command.build_clib` --- Build any C libraries in a package
     1877==========================================================================
     1878
     1879.. module:: distutils.command.build_clib
     1880   :synopsis: Build any C libraries in a package
     1881
     1882
     1883.. % todo
     1884
     1885
     1886:mod:`distutils.command.build_ext` --- Build any extensions in a package
     1887========================================================================
     1888
     1889.. module:: distutils.command.build_ext
     1890   :synopsis: Build any extensions in a package
     1891
     1892
     1893.. % todo
     1894
     1895
     1896:mod:`distutils.command.build_py` --- Build the .py/.pyc files of a package
     1897===========================================================================
     1898
     1899.. module:: distutils.command.build_py
     1900   :synopsis: Build the .py/.pyc files of a package
     1901
     1902
     1903:mod:`distutils.command.build_scripts` --- Build the scripts of a package
     1904=========================================================================
     1905
     1906.. module:: distutils.command.build_scripts
     1907   :synopsis: Build the scripts of a package
     1908
     1909
     1910.. % todo
     1911
     1912
     1913:mod:`distutils.command.clean` --- Clean a package build area
     1914=============================================================
     1915
     1916.. module:: distutils.command.clean
     1917   :synopsis: Clean a package build area
     1918
     1919
     1920.. % todo
     1921
     1922
     1923:mod:`distutils.command.config` --- Perform package configuration
     1924=================================================================
     1925
     1926.. module:: distutils.command.config
     1927   :synopsis: Perform package configuration
     1928
     1929
     1930.. % todo
     1931
     1932
     1933:mod:`distutils.command.install` --- Install a package
     1934======================================================
     1935
     1936.. module:: distutils.command.install
     1937   :synopsis: Install a package
     1938
     1939
     1940.. % todo
     1941
     1942
     1943:mod:`distutils.command.install_data` --- Install data files from a package
     1944===========================================================================
     1945
     1946.. module:: distutils.command.install_data
     1947   :synopsis: Install data files from a package
     1948
     1949
     1950.. % todo
     1951
     1952
     1953:mod:`distutils.command.install_headers` --- Install C/C++ header files from a package
     1954======================================================================================
     1955
     1956.. module:: distutils.command.install_headers
     1957   :synopsis: Install C/C++ header files from a package
     1958
     1959
     1960.. % todo
     1961
     1962
     1963:mod:`distutils.command.install_lib` --- Install library files from a package
     1964=============================================================================
     1965
     1966.. module:: distutils.command.install_lib
     1967   :synopsis: Install library files from a package
     1968
     1969
     1970.. % todo
     1971
     1972
     1973:mod:`distutils.command.install_scripts` --- Install script files from a package
     1974================================================================================
     1975
     1976.. module:: distutils.command.install_scripts
     1977   :synopsis: Install script files from a package
     1978
     1979
     1980.. % todo
     1981
     1982
     1983:mod:`distutils.command.register` --- Register a module with the Python Package Index
     1984=====================================================================================
     1985
     1986.. module:: distutils.command.register
     1987   :synopsis: Register a module with the Python Package Index
     1988
     1989
     1990The ``register`` command registers the package with the Python Package  Index.
     1991This is described in more detail in :pep:`301`.
     1992
     1993.. % todo
     1994
     1995
     1996:mod:`distutils.command.check` --- Check the meta-data of a package
     1997===================================================================
     1998
     1999.. module:: distutils.command.check
     2000   :synopsis: Check the metadata of a package
     2001
     2002
     2003The ``check`` command performs some tests on the meta-data of a package.
     2004For example, it verifies that all required meta-data are provided as
     2005the arguments passed to the :func:`setup` function.
     2006
     2007.. % todo
Note: See TracChangeset for help on using the changeset viewer.