summaryrefslogtreecommitdiff
path: root/docs/userguide
diff options
context:
space:
mode:
authoralvyjudy <alvyjudy@gmail.com>2020-05-14 12:37:17 -0400
committeralvyjudy <alvyjudy@gmail.com>2020-05-14 12:37:17 -0400
commit127cfdfb9a01cfe12a7e6d8bf81aa04c56c2d5f1 (patch)
tree1aace94e9aa11d2190d9fe7098d51e010bada962 /docs/userguide
parent6c6568dbf406597ffd6bd1e77ec3081b70992f7c (diff)
downloadpython-setuptools-git-127cfdfb9a01cfe12a7e6d8bf81aa04c56c2d5f1.tar.gz
docs: udpate package_discovery.txt
Diffstat (limited to 'docs/userguide')
-rw-r--r--docs/userguide/package_discovery.txt22
1 files changed, 17 insertions, 5 deletions
diff --git a/docs/userguide/package_discovery.txt b/docs/userguide/package_discovery.txt
index 722f6fcd..8ba12cdf 100644
--- a/docs/userguide/package_discovery.txt
+++ b/docs/userguide/package_discovery.txt
@@ -2,15 +2,27 @@
Package Discovery
===================
+``Setuptools`` provide powerful tools to handle package discovery, including
+support for namespace package. The following explain how you include package
+in your ``setup`` script::
+
+ setup(
+ packages = ['mypkg1', 'mypkg2']
+ )
+
+To speed things up, we introduce two functions provided by setuptools::
+
+ from setuptools import find_packages
+
+or::
+
+ from setuptools import find_namespace_packages
Using ``find_packages()``
-------------------------
-For simple projects, it's usually easy enough to manually add packages to
-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.
+Let's start with the first tool.
``find_packages()`` takes a source directory and two lists of package name
patterns to exclude and include. If omitted, the source directory defaults to
@@ -166,4 +178,4 @@ You must include the ``declare_namespace()`` line in the ``__init__.py`` of
order to ensure that the namespace will be declared regardless of which
project's copy of ``__init__.py`` is loaded first. If the first loaded
``__init__.py`` doesn't declare it, it will never *be* declared, because no
-other copies will ever be loaded! \ No newline at end of file
+other copies will ever be loaded!