Commit a5ab7612 authored by Serhiy Storchaka's avatar Serhiy Storchaka

#19196: Improved cross-references in distutils documentation.

parent ad16b725
...@@ -989,8 +989,9 @@ directories. ...@@ -989,8 +989,9 @@ directories.
simply the list of all files under *src*, with the names changed to be under simply the list of all files under *src*, with the names changed to be under
*dst*. *dst*.
*preserve_mode* and *preserve_times* are the same as for :func:`copy_file` in *preserve_mode* and *preserve_times* are the same as for
:mod:`distutils.file_util`; note that they only apply to regular files, not to :func:`distutils.file_util.copy_file`; note that they only apply to
regular files, not to
directories. If *preserve_symlinks* is true, symlinks will be copied as directories. If *preserve_symlinks* is true, symlinks will be copied as
symlinks (on platforms that support them!); otherwise (the default), the symlinks (on platforms that support them!); otherwise (the default), the
destination of the symlink will be copied. *update* and *verbose* are the same destination of the symlink will be copied. *update* and *verbose* are the same
...@@ -1172,8 +1173,8 @@ other utility module. ...@@ -1172,8 +1173,8 @@ other utility module.
or :exc:`OSError`) exception object. Handles Python 1.5.1 and later styles, or :exc:`OSError`) exception object. Handles Python 1.5.1 and later styles,
and does what it can to deal with exception objects that don't have a filename and does what it can to deal with exception objects that don't have a filename
(which happens when the error is due to a two-file operation, such as (which happens when the error is due to a two-file operation, such as
:func:`rename` or :func:`link`). Returns the error message as a string :func:`~os.rename` or :func:`~os.link`). Returns the error message as a
prefixed with *prefix*. string prefixed with *prefix*.
.. function:: split_quoted(s) .. function:: split_quoted(s)
...@@ -1257,8 +1258,8 @@ other utility module. ...@@ -1257,8 +1258,8 @@ other utility module.
built/installed/distributed built/installed/distributed
This module provides the :class:`Distribution` class, which represents the This module provides the :class:`~distutils.core.Distribution` class, which
module distribution being built/installed/distributed. represents the module distribution being built/installed/distributed.
:mod:`distutils.extension` --- The Extension class :mod:`distutils.extension` --- The Extension class
...@@ -1706,8 +1707,8 @@ This module supplies the abstract base class :class:`Command`. ...@@ -1706,8 +1707,8 @@ This module supplies the abstract base class :class:`Command`.
options, is the :meth:`run` method, which must also be implemented by every options, is the :meth:`run` method, which must also be implemented by every
command class. command class.
The class constructor takes a single argument *dist*, a :class:`Distribution` The class constructor takes a single argument *dist*, a
instance. :class:`~distutils.core.Distribution` instance.
Creating a new Distutils command Creating a new Distutils command
......
...@@ -139,7 +139,8 @@ directories, libraries to link with, etc.). ...@@ -139,7 +139,8 @@ directories, libraries to link with, etc.).
All of this is done through another keyword argument to :func:`setup`, the All of this is done through another keyword argument to :func:`setup`, the
:option:`ext_modules` option. :option:`ext_modules` is just a list of :option:`ext_modules` option. :option:`ext_modules` is just a list of
:class:`Extension` instances, each of which describes a single extension module. :class:`~distutils.core.Extension` instances, each of which describes a
single extension module.
Suppose your distribution includes a single extension, called :mod:`foo` and Suppose your distribution includes a single extension, called :mod:`foo` and
implemented by :file:`foo.c`. If no additional instructions to the implemented by :file:`foo.c`. If no additional instructions to the
compiler/linker are needed, describing this extension is quite simple:: compiler/linker are needed, describing this extension is quite simple::
...@@ -165,8 +166,8 @@ following sections. ...@@ -165,8 +166,8 @@ following sections.
Extension names and packages Extension names and packages
---------------------------- ----------------------------
The first argument to the :class:`Extension` constructor is always the name of The first argument to the :class:`~distutils.core.Extension` constructor is
the extension, including any package names. For example, :: always the name of the extension, including any package names. For example, ::
Extension('foo', ['src/foo1.c', 'src/foo2.c']) Extension('foo', ['src/foo1.c', 'src/foo2.c'])
...@@ -196,7 +197,8 @@ will compile :file:`foo.c` to the extension :mod:`pkg.foo`, and :file:`bar.c` to ...@@ -196,7 +197,8 @@ will compile :file:`foo.c` to the extension :mod:`pkg.foo`, and :file:`bar.c` to
Extension source files Extension source files
---------------------- ----------------------
The second argument to the :class:`Extension` constructor is a list of source The second argument to the :class:`~distutils.core.Extension` constructor is
a list of source
files. Since the Distutils currently only support C, C++, and Objective-C files. Since the Distutils currently only support C, C++, and Objective-C
extensions, these are normally C/C++/Objective-C source files. (Be sure to use extensions, these are normally C/C++/Objective-C source files. (Be sure to use
appropriate extensions to distinguish C++\ source files: :file:`.cc` and appropriate extensions to distinguish C++\ source files: :file:`.cc` and
...@@ -232,9 +234,9 @@ linked into the executable. ...@@ -232,9 +234,9 @@ linked into the executable.
Preprocessor options Preprocessor options
-------------------- --------------------
Three optional arguments to :class:`Extension` will help if you need to specify Three optional arguments to :class:`~distutils.core.Extension` will help if
include directories to search or preprocessor macros to define/undefine: you need to specify include directories to search or preprocessor macros to
``include_dirs``, ``define_macros``, and ``undef_macros``. define/undefine: ``include_dirs``, ``define_macros``, and ``undef_macros``.
For example, if your extension requires header files in the :file:`include` For example, if your extension requires header files in the :file:`include`
directory under your distribution root, use the ``include_dirs`` option:: directory under your distribution root, use the ``include_dirs`` option::
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment