aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2014-03-16 04:24:32 -0400
committerJason R. Coombs <jaraco@jaraco.com>2014-03-16 04:24:32 -0400
commiteff1456d59d8abf700de991bfd5a36cdfc35df5c (patch)
treef0f4567a96d6dcb3f95acab9e101aeb2df169ab5 /docs
parent3e6b92ec702c3139802b60df651fa14360e382b9 (diff)
downloadexternal_python_setuptools-eff1456d59d8abf700de991bfd5a36cdfc35df5c.tar.gz
external_python_setuptools-eff1456d59d8abf700de991bfd5a36cdfc35df5c.tar.bz2
external_python_setuptools-eff1456d59d8abf700de991bfd5a36cdfc35df5c.zip
Update documentation to reflect new include parameter.3.3
Diffstat (limited to 'docs')
-rw-r--r--docs/setuptools.txt13
1 files changed, 8 insertions, 5 deletions
diff --git a/docs/setuptools.txt b/docs/setuptools.txt
index d277dcb5..6d21fef1 100644
--- a/docs/setuptools.txt
+++ b/docs/setuptools.txt
@@ -416,19 +416,22 @@ the ``packages`` argument of ``setup()``. However, for very large projects
(Twisted, PEAK, Zope, Chandler, etc.), it can be a big burden to keep the
package list updated. That's what ``setuptools.find_packages()`` is for.
-``find_packages()`` takes a source directory, and a list of package names or
-patterns to exclude. If omitted, the source directory defaults to the same
+``find_packages()`` takes a source directory and two lists of package name
+patterns to exclude and include. If omitted, the source directory defaults to
+the same
directory as the setup script. Some projects use a ``src`` or ``lib``
directory as the root of their source tree, and those projects would of course
use ``"src"`` or ``"lib"`` as the first argument to ``find_packages()``. (And
such projects also need something like ``package_dir = {'':'src'}`` in their
``setup()`` arguments, but that's just a normal distutils thing.)
-Anyway, ``find_packages()`` walks the target directory, and finds Python
+Anyway, ``find_packages()`` walks the target directory, filtering by inclusion
+patterns, and finds Python
packages by looking for ``__init__.py`` files. It then filters the list of
packages using the exclusion patterns.
-Exclusion patterns are package names, optionally including wildcards. For
+Inclusion and exclusion patterns are package names, optionally including
+wildcards. For
example, ``find_packages(exclude=["*.tests"])`` will exclude all packages whose
last name part is ``tests``. Or, ``find_packages(exclude=["*.tests",
"*.tests.*"])`` will also exclude any subpackages of packages named ``tests``,
@@ -442,7 +445,7 @@ in order to cover all the bases. Really, the exclusion patterns are intended
to cover simpler use cases than this, like excluding a single, specified
package and its subpackages.
-Regardless of the target directory or exclusions, the ``find_packages()``
+Regardless of the parameters, the ``find_packages()``
function returns a list of package names suitable for use as the ``packages``
argument to ``setup()``, and so is usually the easiest way to set that
argument in your setup script. Especially since it frees you from having to