Commit 127cfdfb authored by alvyjudy's avatar alvyjudy

docs: udpate package_discovery.txt

parent 6c6568db
......@@ -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!
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