Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 59d382e

Browse files
committed
A grab-bag of wording tweakage.
1 parent 0e48cfd commit 59d382e

1 file changed

Lines changed: 54 additions & 29 deletions

File tree

Doc/dist/dist.tex

Lines changed: 54 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ \subsection{A simple example}
100100
\file{.zip}), and will unpack into a directory \file{Foo-1.0}.
101101

102102
If an end-user wishes to install your \module{foo} module, all she has
103-
to do is download \file{Foo-1.0.tar.gz}) (or \file{.zip}), unpack it,
103+
to do is download \file{Foo-1.0.tar.gz} (or \file{.zip}), unpack it,
104104
and---from the \file{Foo-1.0} directory---run
105105
\begin{verbatim}
106106
python setup.py install
@@ -122,21 +122,29 @@ \subsection{A simple example}
122122
running on a Windows machine, and want to make things easy for other
123123
Windows users, you can create an executable installer (the most
124124
appropriate type of built distribution for this platform) with the
125-
\command{bdist\_wise} command. (Wise is the installation tool used to
126-
create Windows installers for Python itself, so we have adopted it for
127-
use by any Python module distribution. You'll need to have version XXX
128-
of Wise installed on your system for the \command{bdist\_wise} to work;
129-
it's available from \url{http://foo/bar/baz}. For example:
125+
\command{bdist\_wininst} command. For example:
130126
\begin{verbatim}
131-
python setup.py bdist_wise
127+
python setup.py bdist_wininst
132128
\end{verbatim}
133129
will create an executable installer, \file{Foo-1\_0.exe}, in the current
134130
directory.
135131

136-
\XXX{not implemented yet}
137-
Other \command{bdist\_*} commands exist for RPM-based Linux systems
138-
(\command{bdist\_rpm}), Debian-based Linux systems
139-
(\command{bdist\_deb}), ...
132+
(Another way to create executable installers for Windows is with the
133+
\command{bdist\_wise} command, which uses Wise---the commercial
134+
installer-generator used to create Python's own installer---to create
135+
the installer. Wise-based installers are more appropriate for large,
136+
industrial-strength applications that need the full capabilities of a
137+
``real'' installer. \command{bdist\_wininst} creates a self-extracting
138+
zip file with a minimal user interface, which is enough for small- to
139+
medium-sized module collections. You'll need to have version XXX of
140+
Wise installed on your system for the \command{bdist\_wise} to work;
141+
it's available from \url{http://foo/bar/baz}.)
142+
143+
Other \command{bdist} commands exist for other platforms: for example,
144+
\command{bdist\_rpm} for RPM-based Linux systems, (\command{bdist\_deb})
145+
for Debian-based Linux systems, and so forth. See
146+
section~\ref{bdist-cmds} for details on all the \command{bdist}
147+
commands.
140148

141149

142150
\subsection{General Python terminology}
@@ -163,6 +171,12 @@ \subsection{General Python terminology}
163171
\item[package] a module that contains other modules; typically contained
164172
in a directory in the filesystem and distinguished from other
165173
directories by the presence of a file \file{\_\_init\_\_.py}.
174+
\item[root package] the ``package'' that modules not in a package live
175+
in. The vast majority of the standard library is in the root package,
176+
as are many small, standalone third-party modules that don't belong to
177+
a larger module collection. (The root package isn't really a package,
178+
since it doesn't have an \file{\_\_init\_\_.py} file. But we have to
179+
call it something.)
166180
\end{description}
167181

168182

@@ -177,8 +191,8 @@ \subsection{Distutils-specific terminology}
177191
\emph{en masse}. Examples of some well-known module distributions are
178192
Numeric Python, PyXML, PIL (the Python Imaging Library), or
179193
mxDateTime. (This would be called a \emph{package}, except that term
180-
is already spoken for in the Python context: a single module
181-
distribution may contain zero, one, or many Python packages.)
194+
is already taken in the Python context: a single module distribution
195+
may contain zero, one, or many Python packages.)
182196
\item[pure module distribution] a module distribution that contains only
183197
pure Python modules and packages. Sometimes referred to as a ``pure
184198
distribution.''
@@ -198,16 +212,17 @@ \section{Writing the Setup Script}
198212
distributing, and installing modules using the Distutils. The main
199213
purpose of the setup script is to describe your module distribution to
200214
the Distutils, so that the various commands that operate on your modules
201-
do the right thing. As we saw in section~\ref{simple-example}
202-
above, the setup script consists mainly of a call to \function{setup()},
203-
and all information supplied to the Distutils is suppled as keyword
215+
do the right thing. As we saw in section~\ref{simple-example} above,
216+
the setup script consists mainly of a call to \function{setup()}, and
217+
all information supplied to the Distutils is supplied as keyword
204218
arguments to \function{setup()}.
205219

206220
Here's a slightly more involved example, which we'll follow for the next
207221
couple of sections: the Distutils' own setup script. (Keep in mind that
208222
although the Distutils are included with Python 1.6, they also have an
209223
independent existence so that Python 1.5 users can use them to install
210-
other module distributions.)
224+
other module distributions. The Distutils' own setup script is used to
225+
install the package into Python 1.5.)
211226

212227
\begin{verbatim}
213228
#!/usr/bin/env python
@@ -235,13 +250,13 @@ \section{Writing the Setup Script}
235250
Note that any pathnames (files or directories) supplied in the setup
236251
script should be written using the Unix convention, i.e.
237252
slash-separated. The Distutils will take care of converting this
238-
platform-neutral representation to whatever is appropriate on your
253+
platform-neutral representation into whatever is appropriate on your
239254
current platform before actually using the pathname. This makes your
240255
setup script portable across operating systems, which of course is one
241256
of the major goals of the Distutils. In this spirit, all pathnames in
242-
this document are slash-separated (Mac OS users should keep in mind that
243-
the \emph{absence} of a leading slash indicates a relative directory,
244-
the opposite of the Mac OS convention with colons).
257+
this document are slash-separated (Mac OS programmers should keep in
258+
mind that the \emph{absence} of a leading slash indicates a relative
259+
path, the opposite of the Mac OS convention with colons).
245260

246261

247262
\subsection{Package directories}
@@ -283,12 +298,16 @@ \subsection{Package directories}
283298
\begin{verbatim}
284299
package_dir = {'foo': 'lib'}
285300
\end{verbatim}
286-
Note that a \code{\var{package}: \var{dir}} entry in the
287-
\option{package\_dir} option implicitly applies to all packages below
288-
\var{package}, so the \module{foo.bar} case is automatically handled
289-
here. In this example, having \code{packages = ['foo', 'foo.bar']}
290-
tells the Distutils to look for \file{lib/\_\_init\_\_.py} and
291-
\file{lib/bar/\_\_init\_\_.py}.
301+
A \code{\var{package}: \var{dir}} entry in the \option{package\_dir}
302+
dictionary implicitly applies to all packages below \var{package}, so
303+
the \module{foo.bar} case is automatically handled here. In this
304+
example, having \code{packages = ['foo', 'foo.bar']} tells the Distutils
305+
to look for \file{lib/\_\_init\_\_.py} and
306+
\file{lib/bar/\_\_init\_\_.py}. (Keep in mind that although
307+
\option{package\_dir} applies recursively, you must explicitly list all
308+
packages in \option{packages}: the Distutils will \emph{not} recursively
309+
scan your source tree looking for any directory with an
310+
\file{\_\_init\_\_.py} file.)
292311

293312

294313
\subsection{Listing individual modules}
@@ -307,8 +326,14 @@ \subsection{Listing individual modules}
307326
layout implies that these two modules can be found in \file{mod1.py} and
308327
\file{pkg/mod2.py}, and that \file{pkg/\_\_init\_\_.py} exists as well.
309328
And again, you can override the package/directory layout using the
310-
\option{package\_dir} option. \XXX{not sure if this is actually
311-
true---must check!}
329+
\option{package\_dir} option.
330+
331+
332+
\subsection{Describing extension modules}
333+
\label{sec:describing-extensions}
334+
335+
\XXX{be sure to describe the whole \code{build\_info} dict, including
336+
\code{extra\_compile\_args} and \code{extra\_link\_args}}
312337

313338

314339
\section{Writing the Setup Configuration File}

0 commit comments

Comments
 (0)