Greg Ward | abc5216 | 2000-02-26 00:52:48 +0000 | [diff] [blame] | 1 | \documentclass{howto} |
| 2 | \usepackage{ltxmarkup} |
Greg Ward | facb8db | 2000-04-09 04:32:40 +0000 | [diff] [blame] | 3 | \usepackage{times} |
Greg Ward | 16aafcd | 2000-04-09 04:06:44 +0000 | [diff] [blame] | 4 | \usepackage{distutils} |
Greg Ward | abc5216 | 2000-02-26 00:52:48 +0000 | [diff] [blame] | 5 | |
Greg Ward | 16aafcd | 2000-04-09 04:06:44 +0000 | [diff] [blame] | 6 | \title{Distributing Python Modules} |
Greg Ward | abc5216 | 2000-02-26 00:52:48 +0000 | [diff] [blame] | 7 | |
Greg Ward | abc5216 | 2000-02-26 00:52:48 +0000 | [diff] [blame] | 8 | \author{Greg Ward} |
| 9 | \authoraddress{E-mail: \email{gward@python.net}} |
| 10 | |
Greg Ward | 16aafcd | 2000-04-09 04:06:44 +0000 | [diff] [blame] | 11 | |
Greg Ward | abc5216 | 2000-02-26 00:52:48 +0000 | [diff] [blame] | 12 | \begin{document} |
| 13 | |
Greg Ward | facb8db | 2000-04-09 04:32:40 +0000 | [diff] [blame] | 14 | \maketitle |
| 15 | \tableofcontents |
Greg Ward | 16aafcd | 2000-04-09 04:06:44 +0000 | [diff] [blame] | 16 | |
| 17 | \section{Introduction} |
Greg Ward | e78298a | 2000-04-28 17:12:24 +0000 | [diff] [blame] | 18 | \label{intro} |
Greg Ward | 16aafcd | 2000-04-09 04:06:44 +0000 | [diff] [blame] | 19 | |
| 20 | In the past, Python module developers have not had much infrastructure |
| 21 | support for distributing modules, nor have Python users had much support |
| 22 | for installing and maintaining third-party modules. With the |
| 23 | introduction of the Python Distribution Utilities (Distutils for short) |
| 24 | in Python 1.6, this situation should start to improve. |
| 25 | |
| 26 | This document only covers using the Distutils to distribute your Python |
| 27 | modules. Using the Distutils does not tie you to Python 1.6, though: |
| 28 | the Distutils work just fine with Python 1.5, and it is reasonable (and |
| 29 | expected to become commonplace) to expect users of Python 1.5 to |
| 30 | download and install the Distutils separately before they can install |
| 31 | your modules. Python 1.6 users, of course, won't have to add anything |
| 32 | to their Python installation in order to use the Distutils to install |
| 33 | third-party modules. |
| 34 | |
| 35 | This document concentrates on the role of developer/distributor: if |
| 36 | you're looking for information on installing Python modules, you should |
| 37 | refer to the ``Installing Python Modules'' manual. |
| 38 | |
| 39 | |
Greg Ward | facb8db | 2000-04-09 04:32:40 +0000 | [diff] [blame] | 40 | \section{Concepts \& Terminology} |
Greg Ward | e78298a | 2000-04-28 17:12:24 +0000 | [diff] [blame] | 41 | \label{concepts} |
Greg Ward | 16aafcd | 2000-04-09 04:06:44 +0000 | [diff] [blame] | 42 | |
| 43 | Using the Distutils is quite simple, both for module developers and for |
| 44 | users/administrators installing third-party modules. As a developer, |
| 45 | your responsibilites (apart from writing solid, well-documented and |
| 46 | well-tested code, of course!) are: |
| 47 | \begin{itemize} |
| 48 | \item write a setup script (\file{setup.py} by convention) |
| 49 | \item (optional) write a setup configuration file |
| 50 | \item create a source distribution |
| 51 | \item (optional) create one or more built (binary) distributions |
| 52 | \end{itemize} |
| 53 | Each of these tasks is covered in this document. |
| 54 | |
| 55 | Not all module developers have access to a multitude of platforms, so |
| 56 | it's not always feasible to expect them to create a multitude of built |
| 57 | distributions. It is hoped that a class of intermediaries, called |
| 58 | \emph{packagers}, will arise to take address this need. Packagers will |
| 59 | take source distributions released by module developers, build them on |
| 60 | one or more platforms, and release the resulting built distributions. |
| 61 | Thus, users on the most popular platforms will be able to install most |
| 62 | popular Python module distributions in the most natural way for their |
| 63 | platform, without having to run a single setup script or compile a line |
| 64 | of code. |
| 65 | |
| 66 | |
| 67 | \subsection{A simple example} |
Greg Ward | e78298a | 2000-04-28 17:12:24 +0000 | [diff] [blame] | 68 | \label{simple-example} |
Greg Ward | 16aafcd | 2000-04-09 04:06:44 +0000 | [diff] [blame] | 69 | |
| 70 | The setup script is usually quite simple, although since it's written in |
| 71 | Python, there are no arbitrary limits to what you can do. If all you |
| 72 | want to do is distribute a module called \module{foo}, contained in a |
| 73 | file \file{foo.py}, then you can get away with as little as this: |
| 74 | \begin{verbatim} |
| 75 | from distutils.core import setup |
| 76 | setup (name = "foo", |
| 77 | version = "1.0", |
| 78 | py_modules = ["foo"]) |
| 79 | \end{verbatim} |
| 80 | Some observations: |
| 81 | \begin{itemize} |
| 82 | \item all information that you supply to the Distutils is supplied as |
Greg Ward | facb8db | 2000-04-09 04:32:40 +0000 | [diff] [blame] | 83 | keyword arguments to the \function{setup()} function |
Greg Ward | 16aafcd | 2000-04-09 04:06:44 +0000 | [diff] [blame] | 84 | \item those keyword arguments fall into two categories: package |
| 85 | meta-data (name, version number) and information about what's in the |
| 86 | package (list of pure modules, in this case) |
| 87 | \item modules are specified by module name, not filename (the same will |
| 88 | hold true for packages and extensions) |
| 89 | \item it's recommended that you supply a little more meta-data, in |
| 90 | particular your name, email address and a URL for the project |
| 91 | \end{itemize} |
| 92 | |
| 93 | To create a source distribution for this module, you would run |
| 94 | \begin{verbatim} |
| 95 | python setup.py sdist |
| 96 | \end{verbatim} |
| 97 | which will create an archive file (e.g., tarball on Unix, zip file on |
| 98 | Windows) containing your setup script, \file{setup.py}, and your module, |
| 99 | \file{foo.py}. The archive file will be named \file{Foo-1.0.tar.gz} (or |
| 100 | \file{.zip}), and will unpack into a directory \file{Foo-1.0}. |
| 101 | |
| 102 | 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, |
| 104 | and---from the \file{Foo-1.0} directory---run |
| 105 | \begin{verbatim} |
| 106 | python setup.py install |
| 107 | \end{verbatim} |
| 108 | which will ultimately copy \file{foo.py} to the appropriate directory |
| 109 | for third-party modules in their Python installation. |
| 110 | |
| 111 | This simple example demonstrates some fundamental concepts of the |
| 112 | Distutils: first, both developers and installers have the same basic |
| 113 | user interface, i.e. the setup script. The difference is which |
| 114 | Distutils \emph{commands} they use: the \command{sdist} command is |
| 115 | almost exclusively for module developers, while \command{install} is |
| 116 | more often for installers (although most developers will want to install |
| 117 | their own code occasionally). |
| 118 | |
| 119 | \XXX{only partially implemented}% |
| 120 | If you want to make things really easy for your users, you can create |
| 121 | one or more built distributions for them. For instance, if you are |
| 122 | running on a Windows machine, and want to make things easy for other |
| 123 | Windows users, you can create an executable installer (the most |
| 124 | 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: |
| 130 | \begin{verbatim} |
| 131 | python setup.py bdist_wise |
| 132 | \end{verbatim} |
Greg Ward | facb8db | 2000-04-09 04:32:40 +0000 | [diff] [blame] | 133 | will create an executable installer, \file{Foo-1\_0.exe}, in the current |
Greg Ward | 16aafcd | 2000-04-09 04:06:44 +0000 | [diff] [blame] | 134 | directory. |
| 135 | |
| 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}), ... |
| 140 | |
| 141 | |
| 142 | \subsection{General Python terminology} |
Greg Ward | e78298a | 2000-04-28 17:12:24 +0000 | [diff] [blame] | 143 | \label{python-terms} |
Greg Ward | 16aafcd | 2000-04-09 04:06:44 +0000 | [diff] [blame] | 144 | |
| 145 | If you're reading this document, you probably have a good idea of what |
| 146 | modules, extensions, and so forth are. Nevertheless, just to be sure |
| 147 | that everyone is operating from a common starting point, we offer the |
| 148 | following glossary of common Python terms: |
| 149 | \begin{description} |
| 150 | \item[module] the basic unit of code reusability in Python: a block of |
| 151 | code imported by some other code. There are three types of modules |
| 152 | that concern us here: pure Python modules, extension modules, and |
| 153 | packages. |
| 154 | \item[pure Python module] a module written in Python and contained in a |
| 155 | single \file{.py} file (and possibly associated \file{.pyc} and/or |
| 156 | \file{.pyo} files). Sometimes referred to as a ``pure module.'' |
| 157 | \item[extension module] a module written in the low-level language of |
| 158 | the Python implemention: C/C++ for CPython, Java for JPython. |
| 159 | Typically contained in a single dynamically loadable pre-compiled |
| 160 | file, e.g. a shared object (\file{.so}) file for CPython extensions on |
| 161 | Unix, a DLL (given the \file{.pyd} extension) for CPython extensions |
| 162 | on Windows, or a Java class file for JPython extensions. |
| 163 | \item[package] a module that contains other modules; typically contained |
| 164 | in a directory in the filesystem and distinguished from other |
| 165 | directories by the presence of a file \file{\_\_init\_\_.py}. |
| 166 | \end{description} |
| 167 | |
| 168 | |
| 169 | \subsection{Distutils-specific terminology} |
Greg Ward | e78298a | 2000-04-28 17:12:24 +0000 | [diff] [blame] | 170 | \label{distutils-term} |
Greg Ward | 16aafcd | 2000-04-09 04:06:44 +0000 | [diff] [blame] | 171 | |
| 172 | The following terms apply more specifically to the domain of |
| 173 | distributing Python modules using the Distutils: |
| 174 | \begin{description} |
| 175 | \item[module distribution] a collection of Python modules distributed |
| 176 | together as a single downloadable resource and meant to be installed |
| 177 | \emph{en masse}. Examples of some well-known module distributions are |
| 178 | Numeric Python, PyXML, PIL (the Python Imaging Library), or |
| 179 | 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.) |
| 182 | \item[pure module distribution] a module distribution that contains only |
| 183 | pure Python modules and packages. Sometimes referred to as a ``pure |
| 184 | distribution.'' |
| 185 | \item[non-pure module distribution] a module distribution that contains |
| 186 | at least one extension module. Sometimes referred to as a ``non-pure |
| 187 | distribution.'' |
| 188 | \item[distribution root] the top-level directory of your source tree (or |
| 189 | source distribution); the directory where \file{setup.py} exists and |
| 190 | is run from |
| 191 | \end{description} |
| 192 | |
| 193 | |
| 194 | \section{Writing the Setup Script} |
Greg Ward | e78298a | 2000-04-28 17:12:24 +0000 | [diff] [blame] | 195 | \label{setup-script} |
Greg Ward | 16aafcd | 2000-04-09 04:06:44 +0000 | [diff] [blame] | 196 | |
| 197 | The setup script is the centre of all activity in building, |
| 198 | distributing, and installing modules using the Distutils. The main |
| 199 | purpose of the setup script is to describe your module distribution to |
Greg Ward | d5767a5 | 2000-04-19 22:48:09 +0000 | [diff] [blame] | 200 | the Distutils, so that the various commands that operate on your modules |
Greg Ward | e78298a | 2000-04-28 17:12:24 +0000 | [diff] [blame] | 201 | do the right thing. As we saw in section~\ref{simple-example} |
Greg Ward | d5767a5 | 2000-04-19 22:48:09 +0000 | [diff] [blame] | 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 |
Greg Ward | facb8db | 2000-04-09 04:32:40 +0000 | [diff] [blame] | 204 | arguments to \function{setup()}. |
Greg Ward | 16aafcd | 2000-04-09 04:06:44 +0000 | [diff] [blame] | 205 | |
| 206 | Here's a slightly more involved example, which we'll follow for the next |
| 207 | couple of sections: the Distutils' own setup script. (Keep in mind that |
| 208 | although the Distutils are included with Python 1.6, they also have an |
| 209 | independent existence so that Python 1.5 users can use them to install |
| 210 | other module distributions.) |
| 211 | |
| 212 | \begin{verbatim} |
| 213 | #!/usr/bin/env python |
| 214 | |
| 215 | from distutils.core import setup |
| 216 | |
| 217 | setup (name = "Distutils", |
| 218 | version = "1.0", |
| 219 | description = "Python Module Distribution Utilities", |
| 220 | author = "Greg Ward", |
| 221 | author_email = "gward@python.net", |
| 222 | url = "http://www.python.org/sigs/distutils-sig/", |
| 223 | |
| 224 | packages = ['distutils', 'distutils.command'], |
| 225 | ) |
| 226 | \end{verbatim} |
| 227 | There are only two differences between this and the trivial one-file |
Greg Ward | e78298a | 2000-04-28 17:12:24 +0000 | [diff] [blame] | 228 | distribution presented in section~\ref{simple-example}: more |
Greg Ward | 16aafcd | 2000-04-09 04:06:44 +0000 | [diff] [blame] | 229 | meta-data, and the specification of pure Python modules by package, |
| 230 | rather than by module. This is important since the Distutils consist of |
| 231 | a couple of dozen modules split into (so far) two packages; an explicit |
| 232 | list of every module would be tedious to generate and difficult to |
| 233 | maintain. |
| 234 | |
Greg Ward | 46b98e3 | 2000-04-14 01:53:36 +0000 | [diff] [blame] | 235 | Note that any pathnames (files or directories) supplied in the setup |
| 236 | script should be written using the Unix convention, i.e. |
| 237 | slash-separated. The Distutils will take care of converting this |
| 238 | platform-neutral representation to whatever is appropriate on your |
| 239 | current platform before actually using the pathname. This makes your |
| 240 | setup script portable across operating systems, which of course is one |
| 241 | 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). |
| 245 | |
Greg Ward | 16aafcd | 2000-04-09 04:06:44 +0000 | [diff] [blame] | 246 | |
| 247 | \subsection{Package directories} |
Greg Ward | e78298a | 2000-04-28 17:12:24 +0000 | [diff] [blame] | 248 | \label{package-dirs} |
Greg Ward | 16aafcd | 2000-04-09 04:06:44 +0000 | [diff] [blame] | 249 | |
| 250 | The \option{packages} option tells the Distutils to process (build, |
| 251 | distribute, install, etc.) all pure Python modules found in each package |
| 252 | mentioned in the \option{packages} list. In order to do this, of |
| 253 | course, there has to be a correspondence between package names and |
| 254 | directories in the filesystem. The default correspondence is the most |
Greg Ward | 1ecc251 | 2000-04-19 22:36:24 +0000 | [diff] [blame] | 255 | obvious one, i.e. package \module{distutils} is found in the directory |
Greg Ward | 16aafcd | 2000-04-09 04:06:44 +0000 | [diff] [blame] | 256 | \file{distutils} relative to the distribution root. Thus, when you say |
| 257 | \code{packages = ['foo']} in your setup script, you are promising that |
| 258 | the Distutils will find a file \file{foo/\_\_init\_\_.py} (which might |
| 259 | be spelled differently on your system, but you get the idea) relative to |
| 260 | the directory where your setup script lives. (If you break this |
| 261 | promise, the Distutils will issue a warning but process the broken |
| 262 | package anyways.) |
| 263 | |
| 264 | If you use a different convention to lay out your source directory, |
| 265 | that's no problem: you just have to supply the \option{package\_dir} |
| 266 | option to tell the Distutils about your convention. For example, say |
| 267 | you keep all Python source under \file{lib}, so that modules not in any |
Greg Ward | 1ecc251 | 2000-04-19 22:36:24 +0000 | [diff] [blame] | 268 | package are right in \file{lib}, modules in the \module{foo} package |
Greg Ward | 16aafcd | 2000-04-09 04:06:44 +0000 | [diff] [blame] | 269 | are in \file{lib/foo}, and so forth. Then you would put |
| 270 | \begin{verbatim} |
| 271 | package_dir = {'': 'lib'} |
| 272 | \end{verbatim} |
| 273 | in your setup script. (The keys to this dictionary are package names, |
| 274 | and an empty package name stands for the ``root package,'' i.e. no |
| 275 | package at all. The values are directory names relative to your |
| 276 | distribution root.) In this case, when you say |
| 277 | \code{packages = ['foo']}, you are promising that the file |
| 278 | \file{lib/foo/\_\_init\_\_.py} exists. |
| 279 | |
Greg Ward | 1ecc251 | 2000-04-19 22:36:24 +0000 | [diff] [blame] | 280 | Another possible convention is to put the \module{foo} package right in |
| 281 | \file{lib}, the \module{foo.bar} package in \file{lib/bar}, etc. This |
Greg Ward | 16aafcd | 2000-04-09 04:06:44 +0000 | [diff] [blame] | 282 | would be written in the setup script as |
| 283 | \begin{verbatim} |
| 284 | package_dir = {'foo': 'lib'} |
| 285 | \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 |
Greg Ward | 1ecc251 | 2000-04-19 22:36:24 +0000 | [diff] [blame] | 288 | \var{package}, so the \module{foo.bar} case is automatically handled |
Greg Ward | 16aafcd | 2000-04-09 04:06:44 +0000 | [diff] [blame] | 289 | here. In this example, having \code{packages = ['foo', 'foo.bar']} |
Greg Ward | facb8db | 2000-04-09 04:32:40 +0000 | [diff] [blame] | 290 | tells the Distutils to look for \file{lib/\_\_init\_\_.py} and |
| 291 | \file{lib/bar/\_\_init\_\_.py}. |
Greg Ward | 16aafcd | 2000-04-09 04:06:44 +0000 | [diff] [blame] | 292 | |
| 293 | |
| 294 | \subsection{Listing individual modules} |
Greg Ward | e78298a | 2000-04-28 17:12:24 +0000 | [diff] [blame] | 295 | \label{listing-modules} |
Greg Ward | 16aafcd | 2000-04-09 04:06:44 +0000 | [diff] [blame] | 296 | |
| 297 | For a small module distribution, you might prefer to list all modules |
| 298 | rather than listing packages---especially the case of a single module |
| 299 | that goes in the ``root package'' (i.e., no package at all). This |
Greg Ward | e78298a | 2000-04-28 17:12:24 +0000 | [diff] [blame] | 300 | simplest case was shown in section~\ref{simple-example}; here is a |
Greg Ward | 16aafcd | 2000-04-09 04:06:44 +0000 | [diff] [blame] | 301 | slightly more involved example: |
| 302 | \begin{verbatim} |
| 303 | py_modules = ['mod1', 'pkg.mod2'] |
| 304 | \end{verbatim} |
| 305 | This describes two modules, one of them in the ``root'' package, the |
Greg Ward | d5767a5 | 2000-04-19 22:48:09 +0000 | [diff] [blame] | 306 | other in the \module{pkg} package. Again, the default package/directory |
| 307 | layout implies that these two modules can be found in \file{mod1.py} and |
| 308 | \file{pkg/mod2.py}, and that \file{pkg/\_\_init\_\_.py} exists as well. |
| 309 | 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!} |
Greg Ward | 16aafcd | 2000-04-09 04:06:44 +0000 | [diff] [blame] | 312 | |
| 313 | |
| 314 | \section{Writing the Setup Configuration File} |
Greg Ward | e78298a | 2000-04-28 17:12:24 +0000 | [diff] [blame] | 315 | \label{setup-config} |
Greg Ward | 16aafcd | 2000-04-09 04:06:44 +0000 | [diff] [blame] | 316 | |
| 317 | \XXX{not implemented yet!} |
| 318 | |
| 319 | Often, it's not possible to write down everything needed to build a |
| 320 | distribution \emph{a priori}. You need to get some information from the |
| 321 | user, or from the user's system, in order to proceed. For example, you |
| 322 | might include an optional extension module that provides an interface to |
| 323 | a particular C library. If that library is installed on the user's |
| 324 | system, then you can build your optional extension---but you need to |
| 325 | know where to find the header and library file. If it's not installed, |
| 326 | you need to know this so you can omit your optional extension. |
| 327 | |
| 328 | The preferred way to do this, of course, would be for you to tell the |
| 329 | Distutils which optional features (C libraries, system calls, external |
| 330 | utilities, etc.) you're looking for, and it would inspect the user's |
| 331 | system and try to find them. This functionality may appear in a future |
| 332 | version of the Distutils, but it isn't there now. So, for the time |
| 333 | being, we rely on the user building and installing your software to |
| 334 | provide the necessary information. The vehicle for doing so is the |
| 335 | setup configuration file, \file{setup.cfg}. |
| 336 | |
| 337 | \XXX{need more here!} |
| 338 | |
| 339 | |
| 340 | \section{Creating a Source Distribution} |
Greg Ward | e78298a | 2000-04-28 17:12:24 +0000 | [diff] [blame] | 341 | \label{source-dist} |
Greg Ward | 16aafcd | 2000-04-09 04:06:44 +0000 | [diff] [blame] | 342 | |
Greg Ward | e78298a | 2000-04-28 17:12:24 +0000 | [diff] [blame] | 343 | As shown in section~\ref{simple-example}, you use the |
Greg Ward | 16aafcd | 2000-04-09 04:06:44 +0000 | [diff] [blame] | 344 | \command{sdist} command to create a source distribution. In the |
| 345 | simplest case, |
| 346 | \begin{verbatim} |
| 347 | python setup.py sdist |
| 348 | \end{verbatim} |
| 349 | (assuming you haven't specified any \command{sdist} options in the setup |
| 350 | script or config file), \command{sdist} creates the the archive of the |
| 351 | default format for the current platform. The default formats are: |
| 352 | \begin{tableii}{ll}{textrm}% |
| 353 | {Platform}{Default archive format for source distributions} |
| 354 | \lineii{Unix}{gzipped tar file (\file{.tar.gz})} |
| 355 | \lineii{Windows}{zip file} |
| 356 | \end{tableii} |
Greg Ward | d5767a5 | 2000-04-19 22:48:09 +0000 | [diff] [blame] | 357 | You can specify as many formats as you like using the |
| 358 | \longprogramopt{formats} option, for example: |
Greg Ward | 16aafcd | 2000-04-09 04:06:44 +0000 | [diff] [blame] | 359 | \begin{verbatim} |
| 360 | python setup.py sdist --formats=gztar,zip |
| 361 | \end{verbatim} |
| 362 | to create a gzipped tarball and a zip file. The available formats are: |
Greg Ward | 46b98e3 | 2000-04-14 01:53:36 +0000 | [diff] [blame] | 363 | \begin{tableiii}{l|l|c}{code}% |
| 364 | {Format}{Description}{Notes} |
| 365 | \lineiii{zip}{zip file (\file{.zip})}{(1)} |
| 366 | \lineiii{gztar}{gzipped tar file (\file{.tar.gz})}{(2)} |
| 367 | \lineiii{ztar}{compressed tar file (\file{.tar.Z})}{} |
| 368 | \lineiii{tar}{tar file (\file{.tar})}{} |
| 369 | \end{tableiii} |
| 370 | |
| 371 | \noindent Notes: |
| 372 | \begin{description} |
| 373 | \item[(1)] default on Windows |
| 374 | \item[(2)] default on Unix |
| 375 | \end{description} |
Greg Ward | 16aafcd | 2000-04-09 04:06:44 +0000 | [diff] [blame] | 376 | |
| 377 | |
| 378 | \subsection{The manifest and manifest template} |
Greg Ward | e78298a | 2000-04-28 17:12:24 +0000 | [diff] [blame] | 379 | \label{manifest} |
Greg Ward | 16aafcd | 2000-04-09 04:06:44 +0000 | [diff] [blame] | 380 | |
| 381 | Without any additional information, the \command{sdist} command puts a |
| 382 | minimal set of files into the source distribution: |
| 383 | \begin{itemize} |
Greg Ward | facb8db | 2000-04-09 04:32:40 +0000 | [diff] [blame] | 384 | \item all Python source files implied by the \option{py\_modules} and |
Greg Ward | 16aafcd | 2000-04-09 04:06:44 +0000 | [diff] [blame] | 385 | \option{packages} options |
Greg Ward | facb8db | 2000-04-09 04:32:40 +0000 | [diff] [blame] | 386 | \item all C source files mentioned in the \option{ext\_modules} or |
Greg Ward | 16aafcd | 2000-04-09 04:06:44 +0000 | [diff] [blame] | 387 | \option{libraries} options (\XXX{getting C library sources currently |
Greg Ward | facb8db | 2000-04-09 04:32:40 +0000 | [diff] [blame] | 388 | broken -- no get\_source\_files() method in build\_clib.py!}) |
Greg Ward | 16aafcd | 2000-04-09 04:06:44 +0000 | [diff] [blame] | 389 | \item anything that looks like a test script: \file{test/test*.py} |
| 390 | (currently, the Distutils don't do anything with test scripts except |
| 391 | include them in source distributions, but in the future there will be |
| 392 | a standard for testing Python module distributions) |
| 393 | \item \file{README.txt} (or \file{README}) and \file{setup.py} |
| 394 | \end{itemize} |
| 395 | Sometimes this is enough, but usually you will want to specify |
| 396 | additional files to distribute. The typical way to do this is to write |
| 397 | a \emph{manifest template}, called \file{MANIFEST.in} by default. The |
| 398 | \command{sdist} command processes this template and generates a manifest |
| 399 | file, \file{MANIFEST}. (If you prefer, you can skip the manifest |
| 400 | template and generate the manifest yourself: it just lists one file per |
| 401 | line.) |
| 402 | |
| 403 | The manifest template has one command per line, where each command |
| 404 | specifies a set of files to include or exclude from the source |
| 405 | distribution. For an example, again we turn to the Distutils' own |
| 406 | manifest template: |
| 407 | \begin{verbatim} |
| 408 | include *.txt |
Greg Ward | 87da1ea | 2000-04-21 04:35:25 +0000 | [diff] [blame] | 409 | recursive-include examples *.txt *.py |
Greg Ward | 16aafcd | 2000-04-09 04:06:44 +0000 | [diff] [blame] | 410 | prune examples/sample?/build |
| 411 | \end{verbatim} |
| 412 | The meanings should be fairly clear: include all files in the |
| 413 | distribution root matching \code{*.txt}, all files anywhere under the |
| 414 | \file{examples} directory matching \code{*.txt} or \code{*.py}, and |
| 415 | exclude all directories matching \code{examples/sample?/build}. There |
| 416 | are several other commands available in the manifest template |
Greg Ward | e78298a | 2000-04-28 17:12:24 +0000 | [diff] [blame] | 417 | mini-language; see section~\ref{sdist-cmd}. |
Greg Ward | 16aafcd | 2000-04-09 04:06:44 +0000 | [diff] [blame] | 418 | |
| 419 | The order of commands in the manifest template very much matters: |
| 420 | initially, we have the list of default files as described above, and |
| 421 | each command in the template adds to or removes from that list of files. |
| 422 | When we have fully processed the manifest template, we have our complete |
| 423 | list of files. This list is written to the manifest for future |
| 424 | reference, and then used to build the source distribution archive(s). |
| 425 | |
Greg Ward | 46b98e3 | 2000-04-14 01:53:36 +0000 | [diff] [blame] | 426 | Following the Distutils' own manifest template, let's trace how the |
| 427 | \command{sdist} command will build the list of files to include in the |
| 428 | Distutils source distribution: |
Greg Ward | 16aafcd | 2000-04-09 04:06:44 +0000 | [diff] [blame] | 429 | \begin{enumerate} |
| 430 | \item include all Python source files in the \file{distutils} and |
| 431 | \file{distutils/command} subdirectories (because packages |
| 432 | corresponding to those two directories were mentioned in the |
| 433 | \option{packages} option in the setup script) |
| 434 | \item include \file{test/test*.py} (always included) |
| 435 | \item include \file{README.txt} and \file{setup.py} (always included) |
| 436 | \item include \file{*.txt} in the distribution root (this will find |
| 437 | \file{README.txt} a second time, but such redundancies are weeded out |
| 438 | later) |
| 439 | \item in the sub-tree under \file{examples}, include anything matching |
| 440 | \file{*.txt} |
| 441 | \item in the sub-tree under \file{examples}, include anything matching |
| 442 | \file{*.py} |
| 443 | \item remove all files in the sub-trees starting at directories matching |
| 444 | \file{examples/sample?/build}---this may exclude files included by the |
| 445 | previous two steps, so it's important that the \code{prune} command in |
| 446 | the manifest template comes after the two \code{recursive-include} |
| 447 | commands |
Greg Ward | facb8db | 2000-04-09 04:32:40 +0000 | [diff] [blame] | 448 | \end{enumerate} |
Greg Ward | 16aafcd | 2000-04-09 04:06:44 +0000 | [diff] [blame] | 449 | |
Greg Ward | 46b98e3 | 2000-04-14 01:53:36 +0000 | [diff] [blame] | 450 | Just like in the setup script, file and directory names in the manifest |
| 451 | template should always be slash-separated; the Distutils will take care |
| 452 | of converting them to the standard representation on your platform. |
| 453 | That way, the manifest template is portable across operating systems. |
| 454 | |
Greg Ward | 16aafcd | 2000-04-09 04:06:44 +0000 | [diff] [blame] | 455 | |
| 456 | \subsection{Manifest-related options} |
Greg Ward | e78298a | 2000-04-28 17:12:24 +0000 | [diff] [blame] | 457 | \label{manifest-options} |
Greg Ward | 16aafcd | 2000-04-09 04:06:44 +0000 | [diff] [blame] | 458 | |
| 459 | The normal course of operations for the \command{sdist} command is as |
| 460 | follows: |
| 461 | \begin{itemize} |
Greg Ward | 46b98e3 | 2000-04-14 01:53:36 +0000 | [diff] [blame] | 462 | \item if the manifest file, \file{MANIFEST} doesn't exist, read |
| 463 | \file{MANIFEST.in} and create the manifest |
| 464 | \item if \file{MANIFEST.in} is more recent than \file{MANIFEST}, |
| 465 | recreate \file{MANIFEST} by reading \file{MANIFEST.in} |
Greg Ward | 16aafcd | 2000-04-09 04:06:44 +0000 | [diff] [blame] | 466 | \item use the list of files now in \file{MANIFEST} (either just |
| 467 | generated or read in) to create the source distribution archive(s) |
| 468 | \end{itemize} |
| 469 | There are a couple of options that modify this behaviour. |
| 470 | |
| 471 | First, you might want to force the manifest to be regenerated---for |
| 472 | example, if you have added or removed files or directories that match an |
| 473 | existing pattern in the manifest template, you should regenerate the |
| 474 | manifest: |
| 475 | \begin{verbatim} |
| 476 | python setup.py sdist --force-manifest |
| 477 | \end{verbatim} |
| 478 | \XXX{this is stupid, but is there a better way to do it without |
| 479 | reprocessing MANIFEST.in every single bloody time?} |
| 480 | |
| 481 | Or, you might just want to (re)generate the manifest, but not create a |
| 482 | source distribution: |
| 483 | \begin{verbatim} |
| 484 | python setup.py sdist --manifest-only |
| 485 | \end{verbatim} |
Greg Ward | a021aca | 2000-04-19 22:34:11 +0000 | [diff] [blame] | 486 | (\longprogramopt{manifest-only} implies \longprogramopt{force-manifest}.) |
Greg Ward | 16aafcd | 2000-04-09 04:06:44 +0000 | [diff] [blame] | 487 | |
| 488 | If you don't want to use the default file set, you can supply the |
Greg Ward | d5767a5 | 2000-04-19 22:48:09 +0000 | [diff] [blame] | 489 | \longprogramopt{no-defaults} option. If you use |
| 490 | \longprogramopt{no-defaults} and don't supply a manifest template (or |
| 491 | it's empty, or nothing matches the patterns in it), then your source |
| 492 | distribution will be empty. |
Greg Ward | 16aafcd | 2000-04-09 04:06:44 +0000 | [diff] [blame] | 493 | |
| 494 | |
| 495 | \section{Creating Built Distributions} |
Greg Ward | e78298a | 2000-04-28 17:12:24 +0000 | [diff] [blame] | 496 | \label{built-dist} |
Greg Ward | 16aafcd | 2000-04-09 04:06:44 +0000 | [diff] [blame] | 497 | |
Greg Ward | 46b98e3 | 2000-04-14 01:53:36 +0000 | [diff] [blame] | 498 | A ``built distribution'' is what you're probably used to thinking of |
| 499 | either as a ``binary package'' or an ``installer'' (depending on your |
| 500 | background). It's not necessarily binary, though, because it might |
| 501 | contain only Python source code and/or byte-code; and we don't call it a |
| 502 | package, because that word is already spoken for in Python. (And |
| 503 | ``installer'' is a term specific to the Windows world. \XXX{do Mac |
| 504 | people use it?}) |
Greg Ward | 16aafcd | 2000-04-09 04:06:44 +0000 | [diff] [blame] | 505 | |
Greg Ward | 46b98e3 | 2000-04-14 01:53:36 +0000 | [diff] [blame] | 506 | A built distribution is how you make life as easy as possible for |
| 507 | installers of your module distribution: for users of RPM-based Linux |
| 508 | systems, it's a binary RPM; for Windows users, it's an executable |
| 509 | installer; for Debian-based Linux users, it's a Debian package; and so |
| 510 | forth. Obviously, no one person will be able to create built |
| 511 | distributions for every platform under the sun, so the Distutils is |
| 512 | designed to enable module developers to concentrate on their |
| 513 | specialty---writing code and creating source distributions---while an |
| 514 | intermediary species of \emph{packager} springs up to turn source |
| 515 | distributions into build distributions for as many platforms as there |
| 516 | are packagers. |
| 517 | |
| 518 | Of course, the module developer could be his own packager; or the |
| 519 | packager could be a volunteer ``out there'' somewhere who has access to |
| 520 | a platform which the original developer does not; or it could be |
| 521 | software periodically grabbing new source distributions and turning them |
| 522 | into built distributions for as many platforms as the software has |
| 523 | access to. Regardless of the nature of the beast, a packager uses the |
| 524 | setup script and the \command{bdist} command family to generate built |
| 525 | distributions. |
| 526 | |
| 527 | As a simple example, if I run the following command in the Distutils |
| 528 | source tree: |
| 529 | \begin{verbatim} |
| 530 | python setup.py bdist |
| 531 | \end{verbatim} |
| 532 | then the Distutils builds my module distribution (the Distutils itself |
| 533 | in this case), does a ``fake'' installation (also in the \file{build} |
| 534 | directory), and creates the default type of built distribution for my |
| 535 | platform. In Distutils 0.8, only two types of built distribution are |
| 536 | supported: \code{gztar} (default on non-Linux Unix) and \code{zip} |
| 537 | (default on Windows). Thus, the above command on a Unix system creates |
| 538 | \file{Distutils-0.8.built-posix.tar.gz}; unpacking this tarball from |
| 539 | Python's \filevar{prefix} directory installs the Distutils just as |
| 540 | though you had downloaded the source distribution and run \code{python |
| 541 | setup.py install}. Obviously, for pure Python distributions, this |
| 542 | isn't a huge win---but for non-pure distributions, which include |
| 543 | extensions that would need to be compiled, it can mean the difference |
| 544 | between someone being able to use your extensions or not. |
| 545 | |
| 546 | \XXX{filenames are inaccurate here!} |
| 547 | |
Greg Ward | d5767a5 | 2000-04-19 22:48:09 +0000 | [diff] [blame] | 548 | The \command{bdist} command has a \longprogramopt{format} option, |
| 549 | similar to the \command{sdist} command, that you can use to select which |
| 550 | formats to generate: for example, |
Greg Ward | 46b98e3 | 2000-04-14 01:53:36 +0000 | [diff] [blame] | 551 | \begin{verbatim} |
| 552 | python setup.py bdist --format=zip |
| 553 | \end{verbatim} |
| 554 | would, when run on a Unix system, create |
| 555 | \file{Distutils-0.8.built-posix.tar.gz}---again, this archive would be |
| 556 | unpacked from Python's \filevar{prefix} directory to install the |
| 557 | Distutils. |
| 558 | |
| 559 | The available formats for built distributions are: |
| 560 | \begin{tableiii}{l|l|c}{code}% |
| 561 | {Format}{Description}{Notes} |
| 562 | \lineiii{zip}{zip file (\file{.zip})}{(1)} |
| 563 | \lineiii{gztar}{gzipped tar file (\file{.tar.gz})}{(2)} |
| 564 | \lineiii{ztar}{compressed tar file (\file{.tar.Z})}{} |
| 565 | \lineiii{tar}{tar file (\file{.tar})}{} |
| 566 | \lineiii{rpm}{RPM}{(3)} |
| 567 | \lineiii{srpm}{source RPM}{} |
| 568 | \lineiii{wise}{Wise installer for Windows}{} |
| 569 | \end{tableiii} |
| 570 | |
| 571 | \noindent Notes: |
| 572 | \begin{description} |
| 573 | \item[(1)] default on Windows |
| 574 | \item[(2)] default on Unix |
| 575 | \item[(3)] not implemented yet; will be default on RPM-based Linux |
| 576 | systems |
| 577 | \item[(5)] not implemented yet; will be default on Windows |
| 578 | \end{description} |
| 579 | |
| 580 | You don't have to use the \command{bdist} command with the |
Greg Ward | d5767a5 | 2000-04-19 22:48:09 +0000 | [diff] [blame] | 581 | \longprogramopt{formats} option; you can also use the command that |
| 582 | directly implements the format you're interested in. Many of these |
Greg Ward | 46b98e3 | 2000-04-14 01:53:36 +0000 | [diff] [blame] | 583 | \command{bdist} ``sub-commands'' actually generate several similar |
| 584 | formats; for instance, the \command{bdist\_dumb} command generates all |
| 585 | the ``dumb'' archive formats (\code{tar}, \code{ztar}, \code{gztar}, and |
| 586 | \code{zip}), and \command{bdist\_rpm} generates both binary and source |
| 587 | RPMs. The \command{bdist} sub-commands, and the formats generated by |
| 588 | each, are: |
| 589 | \begin{tableii}{l|l}{command}% |
| 590 | {Command}{Formats} |
| 591 | \lineii{bdist\_dumb}{tar, ztar, gztar, zip} |
| 592 | \lineii{bdist\_rpm}{rpm, srpm} |
| 593 | \lineii{bdist\_wise}{wise} |
| 594 | \end{tableii} |
Greg Ward | 16aafcd | 2000-04-09 04:06:44 +0000 | [diff] [blame] | 595 | |
| 596 | \section{Examples} |
Greg Ward | e78298a | 2000-04-28 17:12:24 +0000 | [diff] [blame] | 597 | \label{examples} |
Greg Ward | 16aafcd | 2000-04-09 04:06:44 +0000 | [diff] [blame] | 598 | |
| 599 | |
| 600 | \subsection{Pure Python distribution (by module)} |
Greg Ward | e78298a | 2000-04-28 17:12:24 +0000 | [diff] [blame] | 601 | \label{pure-mod} |
Greg Ward | 16aafcd | 2000-04-09 04:06:44 +0000 | [diff] [blame] | 602 | |
| 603 | |
| 604 | \subsection{Pure Python distribution (by package)} |
Greg Ward | e78298a | 2000-04-28 17:12:24 +0000 | [diff] [blame] | 605 | \label{pure-pkg} |
Greg Ward | 16aafcd | 2000-04-09 04:06:44 +0000 | [diff] [blame] | 606 | |
| 607 | |
| 608 | \subsection{Single extension module} |
Greg Ward | e78298a | 2000-04-28 17:12:24 +0000 | [diff] [blame] | 609 | \label{single-ext} |
Greg Ward | 16aafcd | 2000-04-09 04:06:44 +0000 | [diff] [blame] | 610 | |
| 611 | |
| 612 | \subsection{Multiple extension modules} |
Greg Ward | e78298a | 2000-04-28 17:12:24 +0000 | [diff] [blame] | 613 | \label{multiple-ext} |
Greg Ward | 16aafcd | 2000-04-09 04:06:44 +0000 | [diff] [blame] | 614 | |
| 615 | |
| 616 | \subsection{Putting it all together} |
| 617 | |
| 618 | |
Greg Ward | 4a9e722 | 2000-04-25 02:57:36 +0000 | [diff] [blame] | 619 | |
| 620 | \section{Extending the Distutils} |
Greg Ward | e78298a | 2000-04-28 17:12:24 +0000 | [diff] [blame] | 621 | \label{extending} |
Greg Ward | 4a9e722 | 2000-04-25 02:57:36 +0000 | [diff] [blame] | 622 | |
| 623 | |
| 624 | \subsection{Extending existing commands} |
Greg Ward | e78298a | 2000-04-28 17:12:24 +0000 | [diff] [blame] | 625 | \label{extend-existing} |
Greg Ward | 4a9e722 | 2000-04-25 02:57:36 +0000 | [diff] [blame] | 626 | |
| 627 | |
| 628 | \subsection{Writing new commands} |
Greg Ward | e78298a | 2000-04-28 17:12:24 +0000 | [diff] [blame] | 629 | \label{new-commands} |
Greg Ward | 4a9e722 | 2000-04-25 02:57:36 +0000 | [diff] [blame] | 630 | |
| 631 | |
| 632 | |
Greg Ward | 16aafcd | 2000-04-09 04:06:44 +0000 | [diff] [blame] | 633 | \section{Reference} |
Greg Ward | e78298a | 2000-04-28 17:12:24 +0000 | [diff] [blame] | 634 | \label{ref} |
Greg Ward | 16aafcd | 2000-04-09 04:06:44 +0000 | [diff] [blame] | 635 | |
| 636 | |
Greg Ward | facb8db | 2000-04-09 04:32:40 +0000 | [diff] [blame] | 637 | \subsection{Building modules: the \protect\command{build} command family} |
Greg Ward | e78298a | 2000-04-28 17:12:24 +0000 | [diff] [blame] | 638 | \label{build-cmds} |
Greg Ward | 16aafcd | 2000-04-09 04:06:44 +0000 | [diff] [blame] | 639 | |
Greg Ward | facb8db | 2000-04-09 04:32:40 +0000 | [diff] [blame] | 640 | \subsubsection{\protect\command{build}} |
Greg Ward | e78298a | 2000-04-28 17:12:24 +0000 | [diff] [blame] | 641 | \label{build-cmd} |
Greg Ward | 16aafcd | 2000-04-09 04:06:44 +0000 | [diff] [blame] | 642 | |
Greg Ward | facb8db | 2000-04-09 04:32:40 +0000 | [diff] [blame] | 643 | \subsubsection{\protect\command{build\_py}} |
Greg Ward | e78298a | 2000-04-28 17:12:24 +0000 | [diff] [blame] | 644 | \label{build-py-cmd} |
Greg Ward | 16aafcd | 2000-04-09 04:06:44 +0000 | [diff] [blame] | 645 | |
Greg Ward | facb8db | 2000-04-09 04:32:40 +0000 | [diff] [blame] | 646 | \subsubsection{\protect\command{build\_ext}} |
Greg Ward | e78298a | 2000-04-28 17:12:24 +0000 | [diff] [blame] | 647 | \label{build-ext-cmd} |
Greg Ward | 16aafcd | 2000-04-09 04:06:44 +0000 | [diff] [blame] | 648 | |
Greg Ward | facb8db | 2000-04-09 04:32:40 +0000 | [diff] [blame] | 649 | \subsubsection{\protect\command{build\_clib}} |
Greg Ward | e78298a | 2000-04-28 17:12:24 +0000 | [diff] [blame] | 650 | \label{build-clib-cmd} |
Greg Ward | 16aafcd | 2000-04-09 04:06:44 +0000 | [diff] [blame] | 651 | |
| 652 | |
Greg Ward | facb8db | 2000-04-09 04:32:40 +0000 | [diff] [blame] | 653 | \subsection{Installing modules: the \protect\command{install} command family} |
Greg Ward | e78298a | 2000-04-28 17:12:24 +0000 | [diff] [blame] | 654 | \label{install-cmd} |
Greg Ward | 16aafcd | 2000-04-09 04:06:44 +0000 | [diff] [blame] | 655 | |
Gregory P. Smith | 147e5f3 | 2000-05-12 00:58:18 +0000 | [diff] [blame] | 656 | The install command ensures that the build commands have been run and then |
| 657 | runs the subcommands \command{install\_lib}, |
| 658 | \command{install\_data} and |
| 659 | \command{install\_scripts}. |
| 660 | |
| 661 | \subsubsection{\protect\command{install\_lib}} |
| 662 | \label{sec:install-lib-cmd} |
| 663 | |
| 664 | \subsubsection{\protect\command{install\_data}} |
| 665 | \label{sec:install-data-cmd} |
| 666 | This command installs all data files provided with the distribution. |
| 667 | |
| 668 | \subsubsection{\protect\command{install\_scripts}} |
| 669 | \label{sec:install-scripts-cmd} |
| 670 | This command installs all (Python) scripts in the distribution. |
| 671 | |
Greg Ward | 16aafcd | 2000-04-09 04:06:44 +0000 | [diff] [blame] | 672 | |
Greg Ward | facb8db | 2000-04-09 04:32:40 +0000 | [diff] [blame] | 673 | \subsection{Cleaning up: the \protect\command{clean} command} |
Greg Ward | e78298a | 2000-04-28 17:12:24 +0000 | [diff] [blame] | 674 | \label{clean-cmd} |
Greg Ward | 16aafcd | 2000-04-09 04:06:44 +0000 | [diff] [blame] | 675 | |
| 676 | |
Greg Ward | facb8db | 2000-04-09 04:32:40 +0000 | [diff] [blame] | 677 | \subsection{Creating a source distribution: the \protect\command{sdist} command} |
Greg Ward | e78298a | 2000-04-28 17:12:24 +0000 | [diff] [blame] | 678 | \label{sdist-cmd} |
Greg Ward | 16aafcd | 2000-04-09 04:06:44 +0000 | [diff] [blame] | 679 | |
| 680 | |
| 681 | \XXX{fragment moved down from above: needs context!} |
| 682 | The manifest template commands are: |
| 683 | \begin{tableii}{ll}{command}{Command}{Description} |
Greg Ward | 87da1ea | 2000-04-21 04:35:25 +0000 | [diff] [blame] | 684 | \lineii{include \var{pat1} \var{pat2} ... } |
| 685 | {include all files matching any of the listed patterns} |
| 686 | \lineii{exclude \var{pat1} \var{pat2} ... } |
| 687 | {exclude all files matching any of the listed patterns} |
| 688 | \lineii{recursive-include \var{dir} \var{pat1} \var{pat2} ... } |
| 689 | {include all files under \var{dir} matching any of the listed patterns} |
| 690 | \lineii{recursive-exclude \var{dir} \var{pat1} \var{pat2} ...} |
| 691 | {exclude all files under \var{dir} matching any of the listed patterns} |
| 692 | \lineii{global-include \var{pat1} \var{pat2} ...} |
| 693 | {include all files anywhere in the source tree matching |
| 694 | any of the listed patterns} |
| 695 | \lineii{global-exclude \var{pat1} \var{pat2} ...} |
| 696 | {exclude all files anywhere in the source tree matching |
| 697 | any of the listed patterns} |
Greg Ward | 16aafcd | 2000-04-09 04:06:44 +0000 | [diff] [blame] | 698 | \lineii{prune \var{dir}}{exclude all files under \var{dir}} |
| 699 | \lineii{graft \var{dir}}{include all files under \var{dir}} |
| 700 | \end{tableii} |
| 701 | The patterns here are Unix-style ``glob'' patterns: \code{*} matches any |
| 702 | sequence of regular filename characters, \code{?} matches any single |
| 703 | regular filename character, and \code{[\var{range}]} matches any of the |
| 704 | characters in \var{range} (e.g., \code{a-z}, \code{a-zA-Z}, |
Greg Ward | facb8db | 2000-04-09 04:32:40 +0000 | [diff] [blame] | 705 | \code{a-f0-9\_.}). The definition of ``regular filename character'' is |
Greg Ward | 16aafcd | 2000-04-09 04:06:44 +0000 | [diff] [blame] | 706 | platform-specific: on Unix it is anything except slash; on Windows |
| 707 | anything except backslash or colon; on Mac OS anything except colon. |
| 708 | \XXX{Windows and Mac OS support not there yet} |
| 709 | |
| 710 | |
Greg Ward | d5767a5 | 2000-04-19 22:48:09 +0000 | [diff] [blame] | 711 | \subsection{Creating a ``built'' distribution: the |
| 712 | \protect\command{bdist} command family} |
Greg Ward | e78298a | 2000-04-28 17:12:24 +0000 | [diff] [blame] | 713 | \label{bdist-cmds} |
Greg Ward | 16aafcd | 2000-04-09 04:06:44 +0000 | [diff] [blame] | 714 | |
| 715 | |
Greg Ward | facb8db | 2000-04-09 04:32:40 +0000 | [diff] [blame] | 716 | \subsubsection{\protect\command{blib}} |
Greg Ward | 16aafcd | 2000-04-09 04:06:44 +0000 | [diff] [blame] | 717 | |
Greg Ward | facb8db | 2000-04-09 04:32:40 +0000 | [diff] [blame] | 718 | \subsubsection{\protect\command{blib\_dumb}} |
Greg Ward | 16aafcd | 2000-04-09 04:06:44 +0000 | [diff] [blame] | 719 | |
Greg Ward | facb8db | 2000-04-09 04:32:40 +0000 | [diff] [blame] | 720 | \subsubsection{\protect\command{blib\_rpm}} |
Greg Ward | 16aafcd | 2000-04-09 04:06:44 +0000 | [diff] [blame] | 721 | |
Greg Ward | facb8db | 2000-04-09 04:32:40 +0000 | [diff] [blame] | 722 | \subsubsection{\protect\command{blib\_wise}} |
Greg Ward | 16aafcd | 2000-04-09 04:06:44 +0000 | [diff] [blame] | 723 | |
| 724 | |
| 725 | |
| 726 | |
| 727 | |
| 728 | |
| 729 | |
| 730 | |
Greg Ward | abc5216 | 2000-02-26 00:52:48 +0000 | [diff] [blame] | 731 | \end{document} |