11.. _`package_discovery` :
22
33========================================
4- Package Discovery and Namespace Package
4+ Package Discovery and Namespace Packages
55========================================
66
77.. note ::
8- a full specification for the keyword supplied to ``setup.cfg `` or
8+ a full specification for the keywords supplied to ``setup.cfg `` or
99 ``setup.py `` can be found at :doc: `keywords reference </references/keywords >`
1010
1111.. note ::
@@ -15,10 +15,10 @@ Package Discovery and Namespace Package
1515 new to setuptools, the :doc: `quickstart section <quickstart >` is a good
1616 place to start.
1717
18- ``Setuptools `` provide powerful tools to handle package discovery, including
19- support for namespace package .
18+ ``Setuptools `` provides powerful tools to handle package discovery, including
19+ support for namespace packages .
2020
21- Normally, you would specify the package to be included manually in the following manner:
21+ Normally, you would specify the packages to be included manually in the following manner:
2222
2323.. tab :: setup.cfg
2424
@@ -190,7 +190,7 @@ The package folder(s) are placed directly under the project root::
190190
191191This layout is very practical for using the REPL , but in some situations
192192it can be more error- prone (e.g. during tests or if you have a bunch
193- of folders or Python files hanging around your project root)
193+ of folders or Python files hanging around your project root).
194194
195195To avoid confusion, file and folder names that are used by popular tools (or
196196that correspond to well- known conventions, such as distributing documentation
@@ -271,7 +271,7 @@ Finding simple packages
271271---------------------- -
272272Let' s start with the first tool. ``find:`` (``find_packages()``) takes a source
273273directory and two lists of package name patterns to exclude and include, and
274- then return a list of `` str `` representing the packages it could find. To use
274+ then returns a list of `` str `` representing the packages it could find. To use
275275it, consider the following directory::
276276
277277 mypkg
@@ -288,7 +288,7 @@ it, consider the following directory::
288288 └── __init__ .py
289289
290290To have setuptools to automatically include packages found
291- in `` src`` that starts with the name `` pkg`` and not `` additional`` :
291+ in `` src`` that start with the name `` pkg`` and not `` additional`` :
292292
293293.. tab:: setup.cfg
294294
@@ -364,8 +364,8 @@ in ``src`` that starts with the name ``pkg`` and not ``additional``:
364364
365365Finding namespace packages
366366--------------------------
367- `` setuptools`` provides the `` find_namespace:`` (`` find_namespace_packages()`` )
368- which behaves similarly to `` find:`` but works with namespace package .
367+ `` setuptools`` provides `` find_namespace:`` (`` find_namespace_packages()`` )
368+ which behaves similarly to `` find:`` but works with namespace packages .
369369
370370Before diving in , it is important to have a good understanding of what
371371:pep:`namespace packages < 420 > ` are. Here is a quick recap.
@@ -415,7 +415,7 @@ distribution, then you will need to specify:
415415 [options.packages.find]
416416 where = src
417417
418- `` find:`` won' t work because timmins doesn' t contain `` __init__ .py``
418+ `` find:`` won' t work because `` timmins`` doesn' t contain `` __init__ .py``
419419 directly, instead, you have to use `` find_namespace:`` .
420420
421421 You can think of `` find_namespace:`` as identical to `` find:`` except it
@@ -494,15 +494,15 @@ available to your interpreter.
494494
495495Legacy Namespace Packages
496496======================== =
497- The fact you can create namespace package so effortlessly above is credited
498- to `PEP 420 < https:// www.python.org/ dev/ peps/ pep- 0420 / > ` _. It use to be more
497+ The fact you can create namespace packages so effortlessly above is credited
498+ to `PEP 420 < https:// www.python.org/ dev/ peps/ pep- 0420 / > ` _. It used to be more
499499cumbersome to accomplish the same result. Historically, there were two methods
500500to create namespace packages. One is the `` pkg_resources`` style supported by
501501`` setuptools`` and the other one being `` pkgutils`` style offered by
502502`` pkgutils`` module in Python. Both are now considered deprecated despite the
503503fact they still linger in many existing packages. These two differ in many
504504subtle yet significant aspects and you can find out more on `Python packaging
505- user guide < https:// packaging.python.org/ guides/ packaging- namespace- packages/ > `_
505+ user guide < https:// packaging.python.org/ guides/ packaging- namespace- packages/ > `_.
506506
507507
508508`` pkg_resource`` style namespace package
0 commit comments