Skip to content

Commit 90027de

Browse files
Add PEP 621 tab for entry points docs (#1115)
* Add PEP 621 tab for entry points * Maybe fix ref * maybe it can’t handle links in tab headers? * remove tabs again * Better explanation * fix link Co-authored-by: Brian Rutledge <[email protected]>
1 parent 91b599b commit 90027de

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

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

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -120,24 +120,20 @@ a list of packages to :func:`setup`'s ``packages`` argument instead of using
120120
Using package metadata
121121
======================
122122

123-
:doc:`Setuptools <setuptools:index>` provides :doc:`special support
124-
<setuptools:userguide/entry_point>` for plugins. By providing the
125-
``entry_points`` argument to :func:`setup` in :file:`setup.py` plugins can
126-
register themselves for discovery.
123+
Packages can have metadata for plugins described in the :ref:`entry-points`.
124+
By specifying them, a package announces that it contains a specific kind of plugin.
125+
Another package supporting this kind of plugin can use the metadata to discover that plugin.
127126

128127
For example if you have a package named ``myapp-plugin-a`` and it includes
129-
in its :file:`setup.py`:
128+
the following in its ``pyproject.toml``:
130129

131-
.. code-block:: python
130+
.. code-block:: toml
132131
133-
setup(
134-
...
135-
entry_points={'myapp.plugins': 'a = myapp_plugin_a'},
136-
...
137-
)
132+
[project.entry-points.'myapp.plugins']
133+
a = 'myapp_plugin_a'
138134
139135
Then you can discover and load all of the registered entry points by using
140-
:func:`importlib.metadata.entry_points` (or the `backport`_
136+
:func:`importlib.metadata.entry_points` (or the backport_
141137
``importlib_metadata >= 3.6`` for Python 3.6-3.9):
142138

143139
.. code-block:: python

0 commit comments

Comments
 (0)