Changeset 391 for python/trunk/Doc/distutils/apiref.rst
- Timestamp:
- Mar 19, 2014, 11:31:01 PM (11 years ago)
- Location:
- python/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
python/trunk
-
Property svn:mergeinfo
set to
/python/vendor/Python-2.7.6 merged eligible /python/vendor/current merged eligible
-
Property svn:mergeinfo
set to
-
python/trunk/Doc/distutils/apiref.rst
r2 r391 22 22 23 23 The basic do-everything function that does most everything you could ever ask 24 for from a Distutils method. See XXXXX24 for from a Distutils method. 25 25 26 26 The setup function takes a large number of arguments. These are laid out in the 27 27 following table. 28 29 .. tabularcolumns:: |l|L|L| 28 30 29 31 +--------------------+--------------------------------+-------------------------------------------------------------+ … … 32 34 | *name* | The name of the package | a string | 33 35 +--------------------+--------------------------------+-------------------------------------------------------------+ 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` | | 36 39 +--------------------+--------------------------------+-------------------------------------------------------------+ 37 40 | *description* | A single line describing the | a string | … … 48 51 | *maintainer* | The name of the current | a string | 49 52 | | 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 | 53 59 | | current maintainer, if | | 54 60 | | different from the author | | 55 61 +--------------------+--------------------------------+-------------------------------------------------------------+ 56 | *url* | A URL for the package | a URL|62 | *url* | A URL for the package | a string | 57 63 | | (homepage) | | 58 64 +--------------------+--------------------------------+-------------------------------------------------------------+ 59 | *download_url* | A URL to download the package | a URL|65 | *download_url* | A URL to download the package | a string | 60 66 +--------------------+--------------------------------+-------------------------------------------------------------+ 61 67 | *packages* | A list of Python packages that | a list of strings | … … 69 75 | | installed | | 70 76 +--------------------+--------------------------------+-------------------------------------------------------------+ 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 | 72 78 | | be built | :class:`distutils.core.Extension` | 73 79 +--------------------+--------------------------------+-------------------------------------------------------------+ 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 | 79 84 | | class to use | :class:`distutils.core.Distribution` | 80 85 +--------------------+--------------------------------+-------------------------------------------------------------+ … … 86 91 | | setup script | | 87 92 +--------------------+--------------------------------+-------------------------------------------------------------+ 88 | *options* | default options for the setup | a string|93 | *options* | default options for the setup | a dictionary | 89 94 | | script | | 90 95 +--------------------+--------------------------------+-------------------------------------------------------------+ 91 96 | *license* | The license for the package | a string | 92 97 +--------------------+--------------------------------+-------------------------------------------------------------+ 93 | *keywords* | Descriptive meta-data, see | 98 | *keywords* | Descriptive meta-data, see | a list of strings or a comma-separated string | 94 99 | | :pep:`314` | | 95 100 +--------------------+--------------------------------+-------------------------------------------------------------+ 96 | *platforms* | | 101 | *platforms* | | a list of strings or a comma-separated string | 97 102 +--------------------+--------------------------------+-------------------------------------------------------------+ 98 103 | *cmdclass* | A mapping of command names to | a dictionary | … … 122 127 123 128 *stop_after* tells :func:`setup` when to stop processing; possible values: 129 130 .. tabularcolumns:: |l|L| 124 131 125 132 +---------------+---------------------------------------------+ … … 148 155 live elsewhere. 149 156 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` 155 162 156 163 A short description of each of these follows, but see the relevant module for … … 162 169 The Extension class describes a single C or C++extension module in a setup 163 170 script. It accepts the following keyword arguments in its constructor 171 172 .. tabularcolumns:: |l|L|l| 164 173 165 174 +------------------------+--------------------------------+---------------------------+ 166 175 | argument name | value | type | 167 176 +========================+================================+===========================+ 168 | *name* | the full name of the | string|177 | *name* | the full name of the | a string | 169 178 | | extension, including any | | 170 179 | | packages --- ie. *not* a | | … … 172 181 | | Python dotted name | | 173 182 +------------------------+--------------------------------+---------------------------+ 174 | *sources* | list of source filenames, | string|183 | *sources* | list of source filenames, | a list of strings | 175 184 | | relative to the distribution | | 176 185 | | root (where the setup script | | … … 185 194 | | extension. | | 186 195 +------------------------+--------------------------------+---------------------------+ 187 | *include_dirs* | list of directories to search | string|196 | *include_dirs* | list of directories to search | a list of strings | 188 197 | | for C/C++ header files (in | | 189 198 | | Unix form for portability) | | 190 199 +------------------------+--------------------------------+---------------------------+ 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 | | 193 202 | | 2-tuple ``(name, value)``, | | 194 203 | | where *value* is | | … … 201 210 | | line) | | 202 211 +------------------------+--------------------------------+---------------------------+ 203 | *undef_macros* | list of macros to undefine | string|212 | *undef_macros* | list of macros to undefine | a list of strings | 204 213 | | explicitly | | 205 214 +------------------------+--------------------------------+---------------------------+ 206 | *library_dirs* | list of directories to search | string|215 | *library_dirs* | list of directories to search | a list of strings | 207 216 | | for C/C++ libraries at link | | 208 217 | | time | | 209 218 +------------------------+--------------------------------+---------------------------+ 210 | *libraries* | list of library names (not | string|219 | *libraries* | list of library names (not | a list of strings | 211 220 | | filenames or paths) to link | | 212 221 | | against | | 213 222 +------------------------+--------------------------------+---------------------------+ 214 | *runtime_library_dirs* | list of directories to search | string|223 | *runtime_library_dirs* | list of directories to search | a list of strings | 215 224 | | for C/C++ libraries at run | | 216 225 | | time (for shared extensions, | | … … 218 227 | | loaded) | | 219 228 +------------------------+--------------------------------+---------------------------+ 220 | *extra_objects* | list of extra files to link | string|229 | *extra_objects* | list of extra files to link | a list of strings | 221 230 | | with (eg. object files not | | 222 231 | | implied by 'sources', static | | … … 225 234 | | resource files, etc.) | | 226 235 +------------------------+--------------------------------+---------------------------+ 227 | *extra_compile_args* | any extra platform- and | string|236 | *extra_compile_args* | any extra platform- and | a list of strings | 228 237 | | compiler-specific information | | 229 238 | | to use when compiling the | | … … 236 245 | | be anything. | | 237 246 +------------------------+--------------------------------+---------------------------+ 238 | *extra_link_args* | any extra platform- and | string|247 | *extra_link_args* | any extra platform- and | a list of strings | 239 248 | | compiler-specific information | | 240 249 | | to use when linking object | | … … 245 254 | | 'extra_compile_args'. | | 246 255 +------------------------+--------------------------------+---------------------------+ 247 | *export_symbols* | list of symbols to be exported | string|256 | *export_symbols* | list of symbols to be exported | a list of strings | 248 257 | | from a shared extension. Not | | 249 258 | | used on all platforms, and not | | … … 253 262 | | ``init`` + extension_name. | | 254 263 +------------------------+--------------------------------+---------------------------+ 255 | *depends* | list of files that the | string|264 | *depends* | list of files that the | a list of strings | 256 265 | | extension depends on | | 257 266 +------------------------+--------------------------------+---------------------------+ 258 | *language* | extension language (i.e. | string|267 | *language* | extension language (i.e. | a string | 259 268 | | ``'c'``, ``'c++'``, | | 260 269 | | ``'objc'``). Will be detected | | … … 445 454 The optional parameter *value* should be a string; if it is not supplied, then 446 455 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? 448 459 449 460 … … 599 610 *output_libname* should be a library name, not a filename; the filename will be 600 611 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? 602 615 603 616 *debug* is a boolean; if true, debugging information will be included in the … … 717 730 .. method:: CCompiler.execute(func, args[, msg=None, level=1]) 718 731 719 Invokes :func:`distutils.util.execute` This method invokes a Python function732 Invokes :func:`distutils.util.execute`. This method invokes a Python function 720 733 *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. 722 735 723 736 … … 725 738 726 739 Invokes :func:`distutils.util.spawn`. This invokes an external process to run 727 the given command. XXX see also.740 the given command. 728 741 729 742 … … 731 744 732 745 Invokes :func:`distutils.dir_util.mkpath`. This creates a directory and any 733 missing ancestor directories. XXX see also.746 missing ancestor directories. 734 747 735 748 736 749 .. method:: CCompiler.move_file(src, dst) 737 750 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*. 740 752 741 753 742 754 .. method:: CCompiler.announce(msg[, level=1]) 743 755 744 Write a message using :func:`distutils.log.debug`. XXX see also.756 Write a message using :func:`distutils.log.debug`. 745 757 746 758 … … 846 858 This module provides the EMXCCompiler class, a subclass of 847 859 :class:`UnixCCompiler` that handles the EMX port of the GNU C compiler to OS/2. 848 849 850 :mod:`distutils.mwerkscompiler` --- Metrowerks CodeWarrior support851 ==================================================================852 853 .. module:: distutils.mwerkscompiler854 :synopsis: Metrowerks CodeWarrior support855 856 857 Contains :class:`MWerksCompiler`, an implementation of the abstract858 :class:`CCompiler` class for MetroWerks CodeWarrior on the pre-Mac OS X859 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't864 .. % all been documented yet.865 860 866 861 … … 887 882 both default to the current directory. Returns the name of the archive file. 888 883 889 .. XXX This should be changed to support bz2 files.890 891 884 892 885 .. function:: make_tarball(base_name, base_dir[, compress='gzip', verbose=0, dry_run=0]) … … 900 893 or :file:`.Z`). Return the output filename. 901 894 902 .. XXX This should be replaced with calls to the :mod:`tarfile` module.903 904 895 905 896 .. function:: make_zipfile(base_name, base_dir[, verbose=0, dry_run=0]) 906 897 907 898 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` Python899 will be named *base_name* + :file:`.zip`. Uses either the :mod:`zipfile` Python 909 900 module (if available) or the InfoZIP :file:`zip` utility (if installed and 910 901 found on the default search path). If neither tool is available, raises … … 992 983 *dst* must be directory names. If *src* is not a directory, raise 993 984 :exc:`DistutilsFileError`. If *dst* does not exist, it is created with 994 :func:`mkpath`. The end result of the 995 copied to *dst*, and 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*. 996 987 Return the list of files that were copied or might have been copied, using their 997 988 output name. The return value is unaffected by *update* or *dry_run*: it is … … 999 990 *dst*. 1000 991 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 1003 995 directories. If *preserve_symlinks* is true, symlinks will be copied as 1004 996 symlinks (on platforms that support them!); otherwise (the default), the … … 1006 998 as for :func:`copy_file`. 1007 999 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 1008 1007 1009 1008 .. function:: remove_tree(directory[, verbose=0, dry_run=0]) … … 1012 1011 errors are ignored (apart from being reported to ``sys.stdout`` if *verbose* is 1013 1012 true). 1014 1015 **\*\*** Some of this could be replaced with the shutil module? **\*\***1016 1013 1017 1014 … … 1128 1125 * ``macosx-10.6-intel`` 1129 1126 1130 .. % XXX isn't this also provided by some other non-distutils module?1131 1132 1127 1133 1128 .. function:: convert_path(pathname) … … 1179 1174 and does what it can to deal with exception objects that don't have a filename 1180 1175 (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 string1182 prefixed with *prefix*.1176 :func:`~os.rename` or :func:`~os.link`). Returns the error message as a 1177 string prefixed with *prefix*. 1183 1178 1184 1179 … … 1264 1259 1265 1260 1266 This module provides the :class:` Distribution` class, which represents the1267 module distribution being built/installed/distributed.1261 This module provides the :class:`~distutils.core.Distribution` class, which 1262 represents the module distribution being built/installed/distributed. 1268 1263 1269 1264 … … 1328 1323 the "negative alias" of :option:`--verbose`, then :option:`--quiet` on the 1329 1324 command line sets *verbose* to false. 1330 1331 **\*\*** Should be replaced with :mod:`optik` (which is also now known as1332 :mod:`optparse` in Python 2.3 and later). **\*\***1333 1325 1334 1326 … … 1348 1340 Wraps *text* to less than *width* wide. 1349 1341 1350 .. XXX Should be replaced with :mod:`textwrap` (which is available in Python1351 2.3 and later).1352 1342 1353 1343 … … 1411 1401 .. module:: distutils.log 1412 1402 :synopsis: A simple logging mechanism, 282-style 1413 1414 1415 .. XXX Should be replaced with standard :mod:`logging` module.1416 1417 1403 1418 1404 … … 1577 1563 1578 1564 The options are all boolean, and affect the values returned by :meth:`readline` 1565 1566 .. tabularcolumns:: |l|L|l| 1579 1567 1580 1568 +------------------+--------------------------------+---------+ … … 1698 1686 1699 1687 .. module:: distutils.cmd 1700 :synopsis: This module provides the abstract base class Command. This class is subclassed1701 by the modules in the distutils.commandsubpackage.1688 :synopsis: This module provides the abstract base class Command. This class 1689 is subclassed by the modules in the distutils.command subpackage. 1702 1690 1703 1691 … … 1709 1697 Abstract base class for defining command classes, the "worker bees" of the 1710 1698 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. 1945 1712 1946 1713 … … 1951 1718 1952 1719 A 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`.Copy1720 is a sample template in that directory called :file:`command_template`. Copy 1954 1721 this 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 the1956 module (and the command). So, for instance, to create the command1722 implementing. This module should implement a class with the same name as the 1723 module (and the command). So, for instance, to create the command 1957 1724 ``peel_banana`` (so that users can run ``setup.py peel_banana``), you'd copy 1958 :file:`command_template` 1725 :file:`command_template` to :file:`distutils/command/peel_banana.py`, then edit 1959 1726 it so that it's implementing the class :class:`peel_banana`, a subclass of 1960 1727 :class:`distutils.cmd.Command`. 1961 1728 1962 1729 Subclasses of :class:`Command` must define the following methods. 1963 1964 1730 1965 1731 .. method:: Command.initialize_options() … … 1977 1743 always called as late as possible, ie. after any option assignments from the 1978 1744 command-line or from other commands have been done. Thus, this is the place 1979 to tocode option dependencies: if *foo* depends on *bar*, then it is safe to1745 to code option dependencies: if *foo* depends on *bar*, then it is safe to 1980 1746 set *foo* from *bar* as long as *foo* still has the same value it was 1981 1747 assigned in :meth:`initialize_options`. … … 1990 1756 be done by :meth:`run`. 1991 1757 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 1990 The ``register`` command registers the package with the Python Package Index. 1991 This 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 2003 The ``check`` command performs some tests on the meta-data of a package. 2004 For example, it verifies that all required meta-data are provided as 2005 the arguments passed to the :func:`setup` function. 2006 2007 .. % todo
Note:
See TracChangeset
for help on using the changeset viewer.