Skip to content

Commit 4dfa8d8

Browse files
jeej3000jeej1kclaude
committed
Address review: drop same-style requirement, reword missing-directory note
Co-authored-by: jeej1k <351634202+jeej1k@users.noreply.github.com> Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
1 parent 4543b2f commit 4dfa8d8

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

‎source/guides/creating-and-discovering-plugins.rst‎

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -103,16 +103,14 @@ the plugin packages must omit the :file:`__init__.py` for your top-level
103103
package directory (``myapp`` in this case). In the namespace sub-package
104104
directory (``myapp/plugins``) they must either omit :file:`__init__.py`, if
105105
you use :ref:`native namespace packages <native-namespace-packages>`, or
106-
include a pkgutil-style :file:`__init__.py`, if you use the legacy approach;
107-
all plugins have to use the same one. Plugins will also need to list their
108-
packages explicitly or use :func:`setuptools.find_namespace_packages`, as
106+
include a pkgutil-style :file:`__init__.py`, if you use the legacy approach.
107+
Plugins will also need to list their packages explicitly or use :func:`setuptools.find_namespace_packages`, as
109108
:func:`setuptools.find_packages` skips directories without an
110109
:file:`__init__.py`.
111110

112-
With native namespace packages, ``myapp.plugins`` only exists once at least
113-
one plugin is installed, so ``import myapp.plugins`` raises
114-
:exc:`ModuleNotFoundError` if there are none. Make sure your code handles that
115-
case.
111+
With native namespace packages, ``import myapp.plugins`` raises
112+
:exc:`ModuleNotFoundError` if no installed distribution provides the
113+
``myapp/plugins`` directory. Make sure your discovery code handles that case.
116114

117115
.. warning:: Namespace packages are a complex feature and there are several
118116
different ways to create them. It's highly recommended to read the

0 commit comments

Comments
 (0)