Changeset 388 for python/vendor/current/Doc/distutils
- Timestamp:
- Mar 19, 2014, 11:11:30 AM (11 years ago)
- Location:
- python/vendor/current/Doc/distutils
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
python/vendor/current/Doc/distutils/apiref.rst
r2 r388 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 -
python/vendor/current/Doc/distutils/builtdist.rst
r2 r388 81 81 | ``tar`` | tar file (:file:`.tar`) | \(3) | 82 82 +-------------+------------------------------+---------+ 83 | ``zip`` | zip file (:file:`.zip`) | \(4)|83 | ``zip`` | zip file (:file:`.zip`) | (2),(4) | 84 84 +-------------+------------------------------+---------+ 85 85 | ``rpm`` | RPM | \(5) | … … 89 89 | ``sdux`` | HP-UX :program:`swinstall` | | 90 90 +-------------+------------------------------+---------+ 91 | ``rpm`` | RPM | \(5) | 92 +-------------+------------------------------+---------+ 93 | ``wininst`` | self-extracting ZIP file for | (2),(4) | 91 | ``wininst`` | self-extracting ZIP file for | \(4) | 94 92 | | Windows | | 95 93 +-------------+------------------------------+---------+ 94 | ``msi`` | Microsoft Installer. | | 95 +-------------+------------------------------+---------+ 96 96 97 97 98 Notes: … … 102 103 (2) 103 104 default on Windows 104 105 **\*\*** to-do! **\*\***106 105 107 106 (3) … … 134 133 | :command:`bdist_wininst` | wininst | 135 134 +--------------------------+-----------------------+ 135 | :command:`bdist_msi` | msi | 136 +--------------------------+-----------------------+ 136 137 137 138 The following sections give details on the individual :command:`bdist_\*` … … 144 145 ================================= 145 146 146 **\*\***Need to document absolute vs. prefix-relative packages here, but first147 I have to implement it! **\*\*** 147 .. XXX Need to document absolute vs. prefix-relative packages here, but first 148 I have to implement it! 148 149 149 150 … … 174 175 175 176 python setup.py bdist_rpm --packager="John Doe <jdoe@example.org>" \ 176 bdist_wininst --target _version="2.0"177 bdist_wininst --target-version="2.0" 177 178 178 179 Creating RPM packages is driven by a :file:`.spec` file, much as using the … … 239 240 you distribute or package many Python module distributions, you might want to 240 241 put options that apply to all of them in your personal Distutils configuration 241 file (:file:`~/.pydistutils.cfg`). 242 file (:file:`~/.pydistutils.cfg`). If you want to temporarily disable 243 this file, you can pass the --no-user-cfg option to setup.py. 242 244 243 245 There are three steps to building a binary RPM package, all of which are … … 319 321 320 322 By default the installer will display the cool "Python Powered" logo when it is 321 run, but you can also supply your own bitmap which must be a Windows323 run, but you can also supply your own 152x261 bitmap which must be a Windows 322 324 :file:`.bmp` file with the :option:`--bitmap` option. 323 325 … … 355 357 To cross-compile, you must download the Python source code and cross-compile 356 358 Python itself for the platform you are targetting - it is not possible from a 357 binary install tion of Python (as the .lib etc file for other platforms are359 binary installation of Python (as the .lib etc file for other platforms are 358 360 not included.) In practice, this means the user of a 32 bit operating 359 361 system will need to use Visual Studio 2008 to open the … … 372 374 --------------------------- 373 375 374 Starting with Python 2.3, a postinstallation script can be specified w hich the376 Starting with Python 2.3, a postinstallation script can be specified with the 375 377 :option:`--install-script` option. The basename of the script must be 376 378 specified, and the script filename must also be listed in the scripts argument … … 425 427 Which folders are available depends on the exact Windows version, and probably 426 428 also the configuration. For details refer to Microsoft's documentation of the 427 :c func:`SHGetSpecialFolderPath` function.429 :c:func:`SHGetSpecialFolderPath` function. 428 430 429 431 -
python/vendor/current/Doc/distutils/commandref.rst
r2 r388 49 49 50 50 51 .. _sdist-cmd:52 53 Creating a source distribution: the :command:`sdist` command54 ============================================================55 56 **\*\*** fragment moved down from above: needs context! **\*\***57 58 The manifest template commands are:59 60 +-------------------------------------------+-----------------------------------------------+61 | Command | Description |62 +===========================================+===============================================+63 | :command:`include pat1 pat2 ...` | include all files matching any of the listed |64 | | patterns |65 +-------------------------------------------+-----------------------------------------------+66 | :command:`exclude pat1 pat2 ...` | exclude all files matching any of the listed |67 | | patterns |68 +-------------------------------------------+-----------------------------------------------+69 | :command:`recursive-include dir pat1 pat2 | include all files under *dir* matching any of |70 | ...` | the listed patterns |71 +-------------------------------------------+-----------------------------------------------+72 | :command:`recursive-exclude dir pat1 pat2 | exclude all files under *dir* matching any of |73 | ...` | the listed patterns |74 +-------------------------------------------+-----------------------------------------------+75 | :command:`global-include pat1 pat2 ...` | include all files anywhere in the source tree |76 | | matching --- & any of the listed patterns |77 +-------------------------------------------+-----------------------------------------------+78 | :command:`global-exclude pat1 pat2 ...` | exclude all files anywhere in the source tree |79 | | matching --- & any of the listed patterns |80 +-------------------------------------------+-----------------------------------------------+81 | :command:`prune dir` | exclude all files under *dir* |82 +-------------------------------------------+-----------------------------------------------+83 | :command:`graft dir` | include all files under *dir* |84 +-------------------------------------------+-----------------------------------------------+85 86 The patterns here are Unix-style "glob" patterns: ``*`` matches any sequence of87 regular filename characters, ``?`` matches any single regular filename88 character, and ``[range]`` matches any of the characters in *range* (e.g.,89 ``a-z``, ``a-zA-Z``, ``a-f0-9_.``). The definition of "regular filename90 character" is platform-specific: on Unix it is anything except slash; on Windows91 anything except backslash or colon.92 93 **\*\*** Windows support not there yet **\*\***94 95 51 .. % \section{Creating a built distribution: the 96 52 .. % \protect\command{bdist} command family} -
python/vendor/current/Doc/distutils/extending.rst
r2 r388 16 16 convenience. 17 17 18 Most distutils command implementations are subclasses of the :class:`Command`19 class from :mod:`distutils.cmd`. New commands may directly inherit from18 Most distutils command implementations are subclasses of the 19 :class:`distutils.cmd.Command` class. New commands may directly inherit from 20 20 :class:`Command`, while replacements often derive from :class:`Command` 21 21 indirectly, directly subclassing the command they are replacing. Commands are -
python/vendor/current/Doc/distutils/index.rst
r2 r388 7 7 :Authors: Greg Ward, Anthony Baxter 8 8 :Email: distutils-sig@python.org 9 :Release: |version|10 :Date: |today|11 9 12 10 This document describes the Python Distribution Utilities ("Distutils") from … … 25 23 builtdist.rst 26 24 packageindex.rst 27 uploading.rst28 25 examples.rst 29 26 extending.rst -
python/vendor/current/Doc/distutils/introduction.rst
r2 r388 80 80 81 81 To create a source distribution for this module, you would create a setup 82 script, :file:`setup.py`, containing the above code, and run:: 82 script, :file:`setup.py`, containing the above code, and run this command from a 83 terminal:: 83 84 84 85 python setup.py sdist 85 86 86 which will create an archive file (e.g., tarball on Unix, ZIP file on Windows) 87 For Windows, open a command prompt windows (:menuselection:`Start --> 88 Accessories`) and change the command to:: 89 90 setup.py sdist 91 92 :command:`sdist` will create an archive file (e.g., tarball on Unix, ZIP file on Windows) 87 93 containing your setup script :file:`setup.py`, and your module :file:`foo.py`. 88 94 The archive file will be named :file:`foo-1.0.tar.gz` (or :file:`.zip`), and -
python/vendor/current/Doc/distutils/packageindex.rst
r2 r388 1 .. index:: 2 single: Python Package Index (PyPI) 3 single: PyPI; (see Python Package Index (PyPI)) 4 1 5 .. _package-index: 2 6 3 ********************************** 4 Registering with the Package Index 5 ********************************** 6 7 The Python Package Index (PyPI) holds meta-data describing distributions 8 packaged with distutils. The distutils command :command:`register` is used to 9 submit your distribution's meta-data to the index. It is invoked as follows:: 10 11 python setup.py register 7 ******************************* 8 The Python Package Index (PyPI) 9 ******************************* 10 11 The `Python Package Index (PyPI)`_ holds :ref:`meta-data <meta-data>` 12 describing distributions packaged with distutils, as well as package data like 13 distribution files if the package author wishes. 14 15 Distutils exposes two commands for submitting package data to PyPI: the 16 :ref:`register <package-register>` command for submitting meta-data to PyPI 17 and the :ref:`upload <package-upload>` command for submitting distribution 18 files. Both commands read configuration data from a special file called the 19 :ref:`.pypirc file <pypirc>`. PyPI :ref:`displays a home page 20 <package-display>` for each package created from the ``long_description`` 21 submitted by the :command:`register` command. 22 23 24 .. _package-register: 25 26 Registering Packages 27 ==================== 28 29 The distutils command :command:`register` is used to submit your distribution's 30 meta-data to the index. It is invoked as follows:: 31 32 python setup.py register 12 33 13 34 Distutils will respond with the following prompt:: 14 35 15 running register16 We need to know who you are, so please choose either:17 1. use your existing login,18 2. register as a new user,19 3. have the server generate a new password for you (and email it to you), or20 4. quit21 Your selection [default 1]:36 running register 37 We need to know who you are, so please choose either: 38 1. use your existing login, 39 2. register as a new user, 40 3. have the server generate a new password for you (and email it to you), or 41 4. quit 42 Your selection [default 1]: 22 43 23 44 Note: if your username and password are saved locally, you will not see this … … 44 65 Maintainers. 45 66 46 By default PyPI will list all versions of a given package. To hide certain 47 versions, the Hidden property should be set to yes. This must be edited through 48 the web interface. 49 67 By default PyPI displays only the newest version of a given package. The web 68 interface lets one change this default behavior and manually select which 69 versions to display and hide. 70 71 72 .. _package-upload: 73 74 Uploading Packages 75 ================== 76 77 .. versionadded:: 2.5 78 79 The distutils command :command:`upload` pushes the distribution files to PyPI. 80 81 The command is invoked immediately after building one or more distribution 82 files. For example, the command :: 83 84 python setup.py sdist bdist_wininst upload 85 86 will cause the source distribution and the Windows installer to be uploaded to 87 PyPI. Note that these will be uploaded even if they are built using an earlier 88 invocation of :file:`setup.py`, but that only distributions named on the command 89 line for the invocation including the :command:`upload` command are uploaded. 90 91 The :command:`upload` command uses the username, password, and repository URL 92 from the :file:`$HOME/.pypirc` file (see section :ref:`pypirc` for more on this 93 file). If a :command:`register` command was previously called in the same command, 94 and if the password was entered in the prompt, :command:`upload` will reuse the 95 entered password. This is useful if you do not want to store a clear text 96 password in the :file:`$HOME/.pypirc` file. 97 98 You can specify another PyPI server with the ``--repository=url`` option:: 99 100 python setup.py sdist bdist_wininst upload -r http://example.com/pypi 101 102 See section :ref:`pypirc` for more on defining several servers. 103 104 You can use the ``--sign`` option to tell :command:`upload` to sign each 105 uploaded file using GPG (GNU Privacy Guard). The :program:`gpg` program must 106 be available for execution on the system :envvar:`PATH`. You can also specify 107 which key to use for signing using the ``--identity=name`` option. 108 109 Other :command:`upload` options include ``--repository=url`` or 110 ``--repository=section`` where *url* is the url of the server and 111 *section* the name of the section in :file:`$HOME/.pypirc`, and 112 ``--show-response`` (which displays the full response text from the PyPI 113 server for help in debugging upload problems). 114 115 116 .. index:: 117 single: .pypirc file 118 single: Python Package Index (PyPI); .pypirc file 50 119 51 120 .. _pypirc: … … 56 125 The format of the :file:`.pypirc` file is as follows:: 57 126 58 [distutils] 59 index-servers = 60 pypi 61 62 [pypi] 63 repository: <repository-url> 64 username: <username> 65 password: <password> 66 67 *repository* can be omitted and defaults to ``http://www.python.org/pypi``. 68 69 If you want to define another server a new section can be created:: 70 71 [distutils] 72 index-servers = 73 pypi 74 other 75 76 [pypi] 77 repository: <repository-url> 78 username: <username> 79 password: <password> 80 81 [other] 82 repository: http://example.com/pypi 83 username: <username> 84 password: <password> 85 86 The command can then be called with the -r option:: 87 88 python setup.py register -r http://example.com/pypi 89 90 Or even with the section name:: 91 92 python setup.py register -r other 93 127 [distutils] 128 index-servers = 129 pypi 130 131 [pypi] 132 repository: <repository-url> 133 username: <username> 134 password: <password> 135 136 The *distutils* section defines a *index-servers* variable that lists the 137 name of all sections describing a repository. 138 139 Each section describing a repository defines three variables: 140 141 - *repository*, that defines the url of the PyPI server. Defaults to 142 ``http://www.python.org/pypi``. 143 - *username*, which is the registered username on the PyPI server. 144 - *password*, that will be used to authenticate. If omitted the user 145 will be prompt to type it when needed. 146 147 If you want to define another server a new section can be created and 148 listed in the *index-servers* variable:: 149 150 [distutils] 151 index-servers = 152 pypi 153 other 154 155 [pypi] 156 repository: <repository-url> 157 username: <username> 158 password: <password> 159 160 [other] 161 repository: http://example.com/pypi 162 username: <username> 163 password: <password> 164 165 :command:`register` can then be called with the -r option to point the 166 repository to work with:: 167 168 python setup.py register -r http://example.com/pypi 169 170 For convenience, the name of the section that describes the repository 171 may also be used:: 172 173 python setup.py register -r other 174 175 176 .. _package-display: 177 178 PyPI package display 179 ==================== 180 181 The ``long_description`` field plays a special role at PyPI. It is used by 182 the server to display a home page for the registered package. 183 184 If you use the `reStructuredText <http://docutils.sourceforge.net/rst.html>`_ 185 syntax for this field, PyPI will parse it and display an HTML output for 186 the package home page. 187 188 The ``long_description`` field can be attached to a text file located 189 in the package:: 190 191 from distutils.core import setup 192 193 with open('README.txt') as file: 194 long_description = file.read() 195 196 setup(name='Distutils', 197 long_description=long_description) 198 199 In that case, :file:`README.txt` is a regular reStructuredText text file located 200 in the root of the package besides :file:`setup.py`. 201 202 To prevent registering broken reStructuredText content, you can use the 203 :program:`rst2html` program that is provided by the :mod:`docutils` package and 204 check the ``long_description`` from the command line:: 205 206 $ python setup.py --long-description | rst2html.py > output.html 207 208 :mod:`docutils` will display a warning if there's something wrong with your 209 syntax. Because PyPI applies additional checks (e.g. by passing ``--no-raw`` 210 to ``rst2html.py`` in the command above), being able to run the command above 211 without warnings does not guarantee that PyPI will convert the content 212 successfully. 213 214 215 .. _Python Package Index (PyPI): http://pypi.python.org/ -
python/vendor/current/Doc/distutils/setupscript.rst
r2 r388 20 20 the package into Python 1.5.2.) :: 21 21 22 #!/usr/bin/env python23 24 from distutils.core import setup25 26 setup(name='Distutils',27 version='1.0',28 description='Python Distribution Utilities',29 author='Greg Ward',30 author_email='gward@python.net',31 url='http://www.python.org/sigs/distutils-sig/',32 packages=['distutils', 'distutils.command'],33 )22 #!/usr/bin/env python 23 24 from distutils.core import setup 25 26 setup(name='Distutils', 27 version='1.0', 28 description='Python Distribution Utilities', 29 author='Greg Ward', 30 author_email='gward@python.net', 31 url='http://www.python.org/sigs/distutils-sig/', 32 packages=['distutils', 'distutils.command'], 33 ) 34 34 35 35 There are only two differences between this and the trivial one-file … … 54 54 code instead of hardcoding path separators:: 55 55 56 glob.glob(os.path.join('mydir', 'subdir', '*.html'))57 os.listdir(os.path.join('mydir', 'subdir'))56 glob.glob(os.path.join('mydir', 'subdir', '*.html')) 57 os.listdir(os.path.join('mydir', 'subdir')) 58 58 59 59 … … 73 73 might be spelled differently on your system, but you get the idea) relative to 74 74 the directory where your setup script lives. If you break this promise, the 75 Distutils will issue a warning but still process the broken package anyway s.75 Distutils will issue a warning but still process the broken package anyway. 76 76 77 77 If you use a different convention to lay out your source directory, that's no … … 82 82 :file:`lib/foo`, and so forth. Then you would put :: 83 83 84 package_dir = {'': 'lib'}84 package_dir = {'': 'lib'} 85 85 86 86 in your setup script. The keys to this dictionary are package names, and an … … 93 93 written in the setup script as :: 94 94 95 package_dir = {'foo': 'lib'}95 package_dir = {'foo': 'lib'} 96 96 97 97 A ``package: dir`` entry in the :option:`package_dir` dictionary implicitly … … 115 115 section :ref:`distutils-simple-example`; here is a slightly more involved example:: 116 116 117 py_modules = ['mod1', 'pkg.mod2']117 py_modules = ['mod1', 'pkg.mod2'] 118 118 119 119 This describes two modules, one of them in the "root" package, the other in the … … 140 140 All of this is done through another keyword argument to :func:`setup`, the 141 141 :option:`ext_modules` option. :option:`ext_modules` is just a list of 142 :class:`Extension` instances, each of which describes a single extension module. 142 :class:`~distutils.core.Extension` instances, each of which describes a 143 single extension module. 143 144 Suppose your distribution includes a single extension, called :mod:`foo` and 144 145 implemented by :file:`foo.c`. If no additional instructions to the 145 146 compiler/linker are needed, describing this extension is quite simple:: 146 147 147 Extension('foo', ['foo.c'])148 Extension('foo', ['foo.c']) 148 149 149 150 The :class:`Extension` class can be imported from :mod:`distutils.core` along … … 151 152 contains only this one extension and nothing else might be:: 152 153 153 from distutils.core import setup, Extension154 setup(name='foo',155 version='1.0',156 ext_modules=[Extension('foo', ['foo.c'])],157 )154 from distutils.core import setup, Extension 155 setup(name='foo', 156 version='1.0', 157 ext_modules=[Extension('foo', ['foo.c'])], 158 ) 158 159 159 160 The :class:`Extension` class (actually, the underlying extension-building … … 166 167 ---------------------------- 167 168 168 The first argument to the :class:` Extension` constructor is always the name of169 the extension, including any package names. For example, ::170 171 Extension('foo', ['src/foo1.c', 'src/foo2.c'])169 The first argument to the :class:`~distutils.core.Extension` constructor is 170 always the name of the extension, including any package names. For example, :: 171 172 Extension('foo', ['src/foo1.c', 'src/foo2.c']) 172 173 173 174 describes an extension that lives in the root package, while :: 174 175 175 Extension('pkg.foo', ['src/foo1.c', 'src/foo2.c'])176 Extension('pkg.foo', ['src/foo1.c', 'src/foo2.c']) 176 177 177 178 describes the same extension in the :mod:`pkg` package. The source files and … … 184 185 :func:`setup`. For example, :: 185 186 186 setup(...,187 ext_package='pkg',188 ext_modules=[Extension('foo', ['foo.c']),189 Extension('subpkg.bar', ['bar.c'])],190 )187 setup(..., 188 ext_package='pkg', 189 ext_modules=[Extension('foo', ['foo.c']), 190 Extension('subpkg.bar', ['bar.c'])], 191 ) 191 192 192 193 will compile :file:`foo.c` to the extension :mod:`pkg.foo`, and :file:`bar.c` to … … 197 198 ---------------------- 198 199 199 The second argument to the :class:`Extension` constructor is a list of source 200 The second argument to the :class:`~distutils.core.Extension` constructor is 201 a list of source 200 202 files. Since the Distutils currently only support C, C++, and Objective-C 201 203 extensions, these are normally C/C++/Objective-C source files. (Be sure to use … … 208 210 extension. 209 211 210 **\*\*** SWIG support is rough around the edges and largely untested! **\*\*** 212 .. XXX SWIG support is rough around the edges and largely untested! 211 213 212 214 This warning notwithstanding, options to SWIG can be currently passed like 213 215 this:: 214 216 215 setup(...,216 ext_modules=[Extension('_foo', ['foo.i'],217 swig_opts=['-modern', '-I../include'])],218 py_modules=['foo'],219 )217 setup(..., 218 ext_modules=[Extension('_foo', ['foo.i'], 219 swig_opts=['-modern', '-I../include'])], 220 py_modules=['foo'], 221 ) 220 222 221 223 Or on the commandline like this:: 222 224 223 > python setup.py build_ext --swig-opts="-modern -I../include"225 > python setup.py build_ext --swig-opts="-modern -I../include" 224 226 225 227 On some platforms, you can include non-source files that are processed by the … … 233 235 -------------------- 234 236 235 Three optional arguments to :class:` Extension` will help if you need to specify236 include directories to search or preprocessor macros to define/undefine: 237 ``include_dirs``, ``define_macros``, and ``undef_macros``.237 Three optional arguments to :class:`~distutils.core.Extension` will help if 238 you need to specify include directories to search or preprocessor macros to 239 define/undefine: ``include_dirs``, ``define_macros``, and ``undef_macros``. 238 240 239 241 For example, if your extension requires header files in the :file:`include` 240 242 directory under your distribution root, use the ``include_dirs`` option:: 241 243 242 Extension('foo', ['foo.c'], include_dirs=['include'])244 Extension('foo', ['foo.c'], include_dirs=['include']) 243 245 244 246 You can specify absolute directories there; if you know that your extension will … … 246 248 away with :: 247 249 248 Extension('foo', ['foo.c'], include_dirs=['/usr/include/X11'])250 Extension('foo', ['foo.c'], include_dirs=['/usr/include/X11']) 249 251 250 252 You should avoid this sort of non-portable usage if you plan to distribute your 251 253 code: it's probably better to write C code like :: 252 254 253 #include <X11/Xlib.h>255 #include <X11/Xlib.h> 254 256 255 257 If you need to include header files from some other Python extension, you can 256 258 take advantage of the fact that header files are installed in a consistent way 257 by the Distutils :command:`install_header ` command. For example, the Numerical259 by the Distutils :command:`install_headers` command. For example, the Numerical 258 260 Python header files are installed (on a standard Unix installation) to 259 261 :file:`/usr/local/include/python1.5/Numerical`. (The exact location will differ … … 263 265 is to write C code like :: 264 266 265 #include <Numerical/arrayobject.h>267 #include <Numerical/arrayobject.h> 266 268 267 269 If you must put the :file:`Numerical` include directory right into your header … … 269 271 :mod:`distutils.sysconfig` module:: 270 272 271 from distutils.sysconfig import get_python_inc272 incdir = os.path.join(get_python_inc(plat_specific=1), 'Numerical')273 setup(...,274 Extension(..., include_dirs=[incdir]),275 )273 from distutils.sysconfig import get_python_inc 274 incdir = os.path.join(get_python_inc(plat_specific=1), 'Numerical') 275 setup(..., 276 Extension(..., include_dirs=[incdir]), 277 ) 276 278 277 279 Even though this is quite portable---it will work on any Python installation, … … 289 291 For example:: 290 292 291 Extension(...,292 define_macros=[('NDEBUG', '1'),293 ('HAVE_STRFTIME', None)],294 undef_macros=['HAVE_FOO', 'HAVE_BAR'])293 Extension(..., 294 define_macros=[('NDEBUG', '1'), 295 ('HAVE_STRFTIME', None)], 296 undef_macros=['HAVE_FOO', 'HAVE_BAR']) 295 297 296 298 is the equivalent of having this at the top of every C source file:: 297 299 298 #define NDEBUG 1299 #define HAVE_STRFTIME300 #undef HAVE_FOO301 #undef HAVE_BAR300 #define NDEBUG 1 301 #define HAVE_STRFTIME 302 #undef HAVE_FOO 303 #undef HAVE_BAR 302 304 303 305 … … 314 316 library search path on target systems :: 315 317 316 Extension(...,317 libraries=['gdbm', 'readline'])318 Extension(..., 319 libraries=['gdbm', 'readline']) 318 320 319 321 If you need to link with libraries in a non-standard location, you'll have to 320 322 include the location in ``library_dirs``:: 321 323 322 Extension(...,323 library_dirs=['/usr/X11R6/lib'],324 libraries=['X11', 'Xt'])324 Extension(..., 325 library_dirs=['/usr/X11R6/lib'], 326 libraries=['X11', 'Xt']) 325 327 326 328 (Again, this sort of non-portable construct should be avoided if you intend to 327 329 distribute your code.) 328 330 329 **\*\*** Should mention clib libraries here or somewhere else! **\*\*** 331 .. XXX Should mention clib libraries here or somewhere else! 330 332 331 333 … … 348 350 to the list of exported symbols. 349 351 352 The :option:`depends` option is a list of files that the extension depends on 353 (for example header files). The build command will call the compiler on the 354 sources to rebuild extension if any on this files has been modified since the 355 previous build. 350 356 351 357 Relationships between Distributions and Packages … … 376 382 number. The accepted comparison operators are:: 377 383 378 < > ==379 <= >= !=384 < > == 385 <= >= != 380 386 381 387 These can be combined by using multiple qualifiers separated by commas (and … … 424 430 named module or package are understood to be obsoleted. 425 431 432 .. _distutils-installing-scripts: 426 433 427 434 Installing Scripts … … 442 449 way. From the PyXML setup script:: 443 450 444 setup(..., 445 scripts=['scripts/xmlproc_parse', 'scripts/xmlproc_val'] 446 ) 447 451 setup(..., 452 scripts=['scripts/xmlproc_parse', 'scripts/xmlproc_val'] 453 ) 454 455 .. versionchanged:: 2.7 456 All the scripts will also be added to the ``MANIFEST`` 457 file if no template is provided. See :ref:`manifest`. 458 459 .. _distutils-installing-package-data: 448 460 449 461 Installing Package Data … … 469 481 the files can be arranged like this in the source tree:: 470 482 471 setup.py472 src/473 mypkg/474 __init__.py475 module.py476 data/477 tables.dat478 spoons.dat479 forks.dat483 setup.py 484 src/ 485 mypkg/ 486 __init__.py 487 module.py 488 data/ 489 tables.dat 490 spoons.dat 491 forks.dat 480 492 481 493 The corresponding call to :func:`setup` might be:: 482 494 483 setup(...,484 packages=['mypkg'],485 package_dir={'mypkg': 'src/mypkg'},486 package_data={'mypkg': ['data/*.dat']},487 )495 setup(..., 496 packages=['mypkg'], 497 package_dir={'mypkg': 'src/mypkg'}, 498 package_data={'mypkg': ['data/*.dat']}, 499 ) 488 500 489 501 .. versionadded:: 2.4 490 502 503 .. versionchanged:: 2.7 504 All the files that match ``package_data`` will be added to the ``MANIFEST`` 505 file if no template is provided. See :ref:`manifest`. 506 507 508 .. _distutils-additional-files: 491 509 492 510 Installing Additional Files … … 500 518 following way:: 501 519 502 setup(...,503 data_files=[('bitmaps', ['bm/b1.gif', 'bm/b2.gif']),504 ('config', ['cfg/data.cfg']),505 ('/etc/init.d', ['init-script'])]506 )520 setup(..., 521 data_files=[('bitmaps', ['bm/b1.gif', 'bm/b2.gif']), 522 ('config', ['cfg/data.cfg']), 523 ('/etc/init.d', ['init-script'])] 524 ) 507 525 508 526 Note that you can specify the directory names where the data files will be … … 524 542 directory. 525 543 544 .. versionchanged:: 2.7 545 All the files that match ``data_files`` will be added to the ``MANIFEST`` 546 file if no template is provided. See :ref:`manifest`. 547 548 526 549 527 550 .. _meta-data: … … 556 579 | | package | | | 557 580 +----------------------+---------------------------+-----------------+--------+ 558 | ``long_description`` | longer description of the | long string | 581 | ``long_description`` | longer description of the | long string | \(5) | 559 582 | | package | | | 560 583 +----------------------+---------------------------+-----------------+--------+ … … 572 595 573 596 (1) 574 These fields are required.597 These fields are required. 575 598 576 599 (2) 577 It is recommended that versions take the form *major.minor[.patch[.sub]]*.600 It is recommended that versions take the form *major.minor[.patch[.sub]]*. 578 601 579 602 (3) 580 Either the author or the maintainer must be identified. 603 Either the author or the maintainer must be identified. If maintainer is 604 provided, distutils lists it as the author in :file:`PKG-INFO`. 581 605 582 606 (4) 583 These fields should not be used if your package is to be compatible with Python 584 versions prior to 2.2.3 or 2.3. The list is available from the `PyPI website 585 <http://pypi.python.org/pypi>`_. 607 These fields should not be used if your package is to be compatible with Python 608 versions prior to 2.2.3 or 2.3. The list is available from the `PyPI website 609 <http://pypi.python.org/pypi>`_. 610 611 (5) 612 The ``long_description`` field is used by PyPI when you are 613 :ref:`registering <package-register>` a package, to 614 :ref:`build its home page <package-display>`. 586 615 587 616 (6) … … 593 622 594 623 'short string' 595 A single line of text, not more than 200 characters.624 A single line of text, not more than 200 characters. 596 625 597 626 'long string' 598 Multiple lines of plain text in reStructuredText format (see599 http://docutils.sf.net/).627 Multiple lines of plain text in reStructuredText format (see 628 http://docutils.sf.net/). 600 629 601 630 'list of strings' 602 See below.631 See below. 603 632 604 633 None of the string values may be Unicode. … … 616 645 617 646 0.1.0 618 the first, experimental release of a package647 the first, experimental release of a package 619 648 620 649 1.0.1a2 621 the second alpha release of the first patch version of 1.0650 the second alpha release of the first patch version of 1.0 622 651 623 652 :option:`classifiers` are specified in a Python list:: 624 653 625 setup(...,626 classifiers=[627 'Development Status :: 4 - Beta',628 'Environment :: Console',629 'Environment :: Web Environment',630 'Intended Audience :: End Users/Desktop',631 'Intended Audience :: Developers',632 'Intended Audience :: System Administrators',633 'License :: OSI Approved :: Python Software Foundation License',634 'Operating System :: MacOS :: MacOS X',635 'Operating System :: Microsoft :: Windows',636 'Operating System :: POSIX',637 'Programming Language :: Python',638 'Topic :: Communications :: Email',639 'Topic :: Office/Business',640 'Topic :: Software Development :: Bug Tracking',641 ],642 )654 setup(..., 655 classifiers=[ 656 'Development Status :: 4 - Beta', 657 'Environment :: Console', 658 'Environment :: Web Environment', 659 'Intended Audience :: End Users/Desktop', 660 'Intended Audience :: Developers', 661 'Intended Audience :: System Administrators', 662 'License :: OSI Approved :: Python Software Foundation License', 663 'Operating System :: MacOS :: MacOS X', 664 'Operating System :: Microsoft :: Windows', 665 'Operating System :: POSIX', 666 'Programming Language :: Python', 667 'Topic :: Communications :: Email', 668 'Topic :: Office/Business', 669 'Topic :: Software Development :: Bug Tracking', 670 ], 671 ) 643 672 644 673 If you wish to include classifiers in your :file:`setup.py` file and also wish … … 647 676 :func:`setup` call. :: 648 677 649 # patch distutils if it can't cope with the "classifiers" or650 # "download_url" keywords651 from sys import version652 if version < '2.2.3':653 from distutils.dist import DistributionMetadata654 DistributionMetadata.classifiers = None655 DistributionMetadata.download_url = None678 # patch distutils if it can't cope with the "classifiers" or 679 # "download_url" keywords 680 from sys import version 681 if version < '2.2.3': 682 from distutils.dist import DistributionMetadata 683 DistributionMetadata.classifiers = None 684 DistributionMetadata.download_url = None 656 685 657 686 … … 675 704 information what it is doing, and prints the full traceback in case an exception 676 705 occurs. 677 678 -
python/vendor/current/Doc/distutils/sourcedist.rst
r2 r388 27 27 | ``zip`` | zip file (:file:`.zip`) | (1),(3) | 28 28 +-----------+-------------------------+---------+ 29 | ``gztar`` | gzip'ed tar file | (2),(4)|29 | ``gztar`` | gzip'ed tar file | \(2) | 30 30 | | (:file:`.tar.gz`) | | 31 31 +-----------+-------------------------+---------+ 32 | ``bztar`` | bzip2'ed tar file | \(4)|32 | ``bztar`` | bzip2'ed tar file | | 33 33 | | (:file:`.tar.bz2`) | | 34 34 +-----------+-------------------------+---------+ … … 36 36 | | (:file:`.tar.Z`) | | 37 37 +-----------+-------------------------+---------+ 38 | ``tar`` | tar file (:file:`.tar`) | \(4)|38 | ``tar`` | tar file (:file:`.tar`) | | 39 39 +-----------+-------------------------+---------+ 40 40 … … 52 52 53 53 (4) 54 requires external utilities: :program:`tar` and possibly one of :program:`gzip`, 55 :program:`bzip2`, or :program:`compress` 54 requires the :program:`compress` program. 55 56 When using any ``tar`` format (``gztar``, ``bztar``, ``ztar`` or 57 ``tar``) under Unix, you can specify the ``owner`` and ``group`` names 58 that will be set for each member of the archive. 59 60 For example, if you want all files of the archive to be owned by root:: 61 62 python setup.py sdist --owner=root --group=root 56 63 57 64 … … 69 76 70 77 * all C source files mentioned in the :option:`ext_modules` or 71 :option:`libraries` options (72 73 **\*\*** getting C library sources currently broken---no74 :meth:`get_source_files` method in :file:`build_clib.py`! **\*\***)78 :option:`libraries` options 79 80 .. XXX Getting C library sources is currently broken -- no 81 :meth:`get_source_files` method in :file:`build_clib.py`! 75 82 76 83 * scripts identified by the :option:`scripts` option 84 See :ref:`distutils-installing-scripts`. 77 85 78 86 * anything that looks like a test script: :file:`test/test\*.py` (currently, the … … 83 91 * :file:`README.txt` (or :file:`README`), :file:`setup.py` (or whatever you 84 92 called your setup script), and :file:`setup.cfg` 93 94 * all files that matches the ``package_data`` metadata. 95 See :ref:`distutils-installing-package-data`. 96 97 * all files that matches the ``data_files`` metadata. 98 See :ref:`distutils-additional-files`. 85 99 86 100 Sometimes this is enough, but usually you will want to specify additional files … … 97 111 described above does not apply in this case. 98 112 113 .. versionchanged:: 2.7 114 An existing generated :file:`MANIFEST` will be regenerated without 115 :command:`sdist` comparing its modification time to the one of 116 :file:`MANIFEST.in` or :file:`setup.py`. 117 118 .. versionchanged:: 2.7.1 119 :file:`MANIFEST` files start with a comment indicating they are generated. 120 Files without this comment are not overwritten or removed. 121 122 .. versionchanged:: 2.7.3 123 :command:`sdist` will read a :file:`MANIFEST` file if no :file:`MANIFEST.in` 124 exists, like it did before 2.7. 125 126 See :ref:`manifest_template` section for a syntax reference. 127 128 129 .. _manifest-options: 130 131 Manifest-related options 132 ======================== 133 134 The normal course of operations for the :command:`sdist` command is as follows: 135 136 * if the manifest file (:file:`MANIFEST` by default) exists and the first line 137 does not have a comment indicating it is generated from :file:`MANIFEST.in`, 138 then it is used as is, unaltered 139 140 * if the manifest file doesn't exist or has been previously automatically 141 generated, read :file:`MANIFEST.in` and create the manifest 142 143 * if neither :file:`MANIFEST` nor :file:`MANIFEST.in` exist, create a manifest 144 with just the default file set 145 146 * use the list of files now in :file:`MANIFEST` (either just generated or read 147 in) to create the source distribution archive(s) 148 149 There are a couple of options that modify this behaviour. First, use the 150 :option:`--no-defaults` and :option:`--no-prune` to disable the standard 151 "include" and "exclude" sets. 152 153 Second, you might just want to (re)generate the manifest, but not create a 154 source distribution:: 155 156 python setup.py sdist --manifest-only 157 158 :option:`-o` is a shortcut for :option:`--manifest-only`. 159 160 .. _manifest_template: 161 162 The MANIFEST.in template 163 ======================== 164 165 A :file:`MANIFEST.in` file can be added in a project to define the list of 166 files to include in the distribution built by the :command:`sdist` command. 167 168 When :command:`sdist` is run, it will look for the :file:`MANIFEST.in` file 169 and interpret it to generate the :file:`MANIFEST` file that contains the 170 list of files that will be included in the package. 171 172 This mechanism can be used when the default list of files is not enough. 173 (See :ref:`manifest`). 174 175 Principle 176 --------- 177 99 178 The manifest template has one command per line, where each command specifies a 100 179 set of files to include or exclude from the source distribution. For an 101 example, again we turn tothe Distutils' own manifest template::180 example, let's look at the Distutils' own manifest template:: 102 181 103 182 include *.txt … … 111 190 include set, so you can exclude files from the standard set with explicit 112 191 instructions in the manifest template. (Or, you can use the 113 :option:`--no-defaults` option to disable the standard set entirely.) There are 114 several other commands available in the manifest template mini-language; see 115 section :ref:`sdist-cmd`. 192 :option:`--no-defaults` option to disable the standard set entirely.) 116 193 117 194 The order of commands in the manifest template matters: initially, we have the … … 167 244 template is portable across operating systems. 168 245 169 170 .. _manifest-options: 171 172 Manifest-related options 173 ======================== 174 175 The normal course of operations for the :command:`sdist` command is as follows: 176 177 * if the manifest file, :file:`MANIFEST` doesn't exist, read :file:`MANIFEST.in` 178 and create the manifest 179 180 * if neither :file:`MANIFEST` nor :file:`MANIFEST.in` exist, create a manifest 181 with just the default file set 182 183 * if either :file:`MANIFEST.in` or the setup script (:file:`setup.py`) are more 184 recent than :file:`MANIFEST`, recreate :file:`MANIFEST` by reading 185 :file:`MANIFEST.in` 186 187 * use the list of files now in :file:`MANIFEST` (either just generated or read 188 in) to create the source distribution archive(s) 189 190 There are a couple of options that modify this behaviour. First, use the 191 :option:`--no-defaults` and :option:`--no-prune` to disable the standard 192 "include" and "exclude" sets. 193 194 Second, you might want to force the manifest to be regenerated---for example, if 195 you have added or removed files or directories that match an existing pattern in 196 the manifest template, you should regenerate the manifest:: 197 198 python setup.py sdist --force-manifest 199 200 Or, you might just want to (re)generate the manifest, but not create a source 201 distribution:: 202 203 python setup.py sdist --manifest-only 204 205 :option:`--manifest-only` implies :option:`--force-manifest`. :option:`-o` is a 206 shortcut for :option:`--manifest-only`, and :option:`-f` for 207 :option:`--force-manifest`. 208 209 246 Commands 247 -------- 248 249 The manifest template commands are: 250 251 +-------------------------------------------+-----------------------------------------------+ 252 | Command | Description | 253 +===========================================+===============================================+ 254 | :command:`include pat1 pat2 ...` | include all files matching any of the listed | 255 | | patterns | 256 +-------------------------------------------+-----------------------------------------------+ 257 | :command:`exclude pat1 pat2 ...` | exclude all files matching any of the listed | 258 | | patterns | 259 +-------------------------------------------+-----------------------------------------------+ 260 | :command:`recursive-include dir pat1 pat2 | include all files under *dir* matching any of | 261 | ...` | the listed patterns | 262 +-------------------------------------------+-----------------------------------------------+ 263 | :command:`recursive-exclude dir pat1 pat2 | exclude all files under *dir* matching any of | 264 | ...` | the listed patterns | 265 +-------------------------------------------+-----------------------------------------------+ 266 | :command:`global-include pat1 pat2 ...` | include all files anywhere in the source tree | 267 | | matching --- & any of the listed patterns | 268 +-------------------------------------------+-----------------------------------------------+ 269 | :command:`global-exclude pat1 pat2 ...` | exclude all files anywhere in the source tree | 270 | | matching --- & any of the listed patterns | 271 +-------------------------------------------+-----------------------------------------------+ 272 | :command:`prune dir` | exclude all files under *dir* | 273 +-------------------------------------------+-----------------------------------------------+ 274 | :command:`graft dir` | include all files under *dir* | 275 +-------------------------------------------+-----------------------------------------------+ 276 277 The patterns here are Unix-style "glob" patterns: ``*`` matches any sequence of 278 regular filename characters, ``?`` matches any single regular filename 279 character, and ``[range]`` matches any of the characters in *range* (e.g., 280 ``a-z``, ``a-zA-Z``, ``a-f0-9_.``). The definition of "regular filename 281 character" is platform-specific: on Unix it is anything except slash; on Windows 282 anything except backslash or colon. -
python/vendor/current/Doc/distutils/uploading.rst
r2 r388 1 .. _package-upload:1 :orphan: 2 2 3 3 *************************************** … … 5 5 *************************************** 6 6 7 .. versionadded:: 2.5 8 9 The Python Package Index (PyPI) not only stores the package info, but also the 10 package data if the author of the package wishes to. The distutils command 11 :command:`upload` pushes the distribution files to PyPI. 12 13 The command is invoked immediately after building one or more distribution 14 files. For example, the command :: 15 16 python setup.py sdist bdist_wininst upload 17 18 will cause the source distribution and the Windows installer to be uploaded to 19 PyPI. Note that these will be uploaded even if they are built using an earlier 20 invocation of :file:`setup.py`, but that only distributions named on the command 21 line for the invocation including the :command:`upload` command are uploaded. 22 23 The :command:`upload` command uses the username, password, and repository URL 24 from the :file:`$HOME/.pypirc` file (see section :ref:`pypirc` for more on this 25 file). 26 27 You can specify another PyPI server with the :option:`--repository=*url*` option:: 28 29 python setup.py sdist bdist_wininst upload -r http://example.com/pypi 30 31 See section :ref:`pypirc` for more on defining several servers. 32 33 You can use the :option:`--sign` option to tell :command:`upload` to sign each 34 uploaded file using GPG (GNU Privacy Guard). The :program:`gpg` program must 35 be available for execution on the system :envvar:`PATH`. You can also specify 36 which key to use for signing using the :option:`--identity=*name*` option. 37 38 Other :command:`upload` options include :option:`--repository=<url>` or 39 :option:`--repository=<section>` where *url* is the url of the server and 40 *section* the name of the section in :file:`$HOME/.pypirc`, and 41 :option:`--show-response` (which displays the full response text from the PyPI 42 server for help in debugging upload problems). 43 7 The contents of this page have moved to the section :ref:`package-index`.
Note:
See TracChangeset
for help on using the changeset viewer.