Skip to content

Commit 33e5083

Browse files
authored
Merge pull request #1923 from Viicos/entry-points-docs
Update documentation regarding entry points
2 parents 5c52d75 + 6659b21 commit 33e5083

File tree

3 files changed

+23
-16
lines changed

3 files changed

+23
-16
lines changed

docs/source/conf.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,11 @@
296296

297297

298298
# Example configuration for intersphinx: refer to the Python standard library.
299-
intersphinx_mapping = {"python": ("https://docs.python.org/3/", None)}
299+
intersphinx_mapping = {
300+
"python": ("https://docs.python.org/3/", None),
301+
"packaging": ("https://packaging.python.org/en/latest/", None),
302+
"setuptools": ("https://setuptools.pypa.io/en/latest/", None),
303+
}
300304

301305
extlinks = {
302306
"issue": ("https://github.com/pycqa/flake8/issues/%s", "#%s"),

docs/source/plugin-development/index.rst

+4-5
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ To get started writing a |Flake8| :term:`plugin` you first need:
3030

3131
Once you've gathered these things, you can get started.
3232

33-
All plugins for |Flake8| must be registered via `entry points`_. In this
33+
All plugins for |Flake8| must be registered via
34+
:external+packaging:doc:`entry points<specifications/entry-points>`. In this
3435
section we cover:
3536

3637
- How to register your plugin so |Flake8| can find it
@@ -54,6 +55,8 @@ Here's a tutorial which goes over building an ast checking plugin from scratch:
5455
<iframe src="https://www.youtube.com/embed/ot5Z4KQPBL8" frameborder="0" allowfullscreen style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"></iframe>
5556
</div>
5657

58+
Detailed Plugin Development Documentation
59+
=========================================
5760

5861
.. toctree::
5962
:caption: Plugin Developer Documentation
@@ -62,7 +65,3 @@ Here's a tutorial which goes over building an ast checking plugin from scratch:
6265
registering-plugins
6366
plugin-parameters
6467
formatters
65-
66-
67-
.. _entry points:
68-
https://setuptools.readthedocs.io/en/latest/pkg_resources.html#entry-points

docs/source/plugin-development/registering-plugins.rst

+14-10
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,18 @@ To register any kind of plugin with |Flake8|, you need:
1212

1313
#. A name for your plugin that will (ideally) be unique.
1414

15-
#. A somewhat recent version of setuptools (newer than 0.7.0 but preferably as
16-
recent as you can attain).
17-
18-
|Flake8| relies on functionality provided by setuptools called
19-
`Entry Points`_. These allow any package to register a plugin with |Flake8|
20-
via that package's ``setup.py`` file.
15+
|Flake8| relies on functionality provided by build tools called
16+
:external+packaging:doc:`entry points<specifications/entry-points>`. These
17+
allow any package to register a plugin with |Flake8| via that package's
18+
metadata.
2119

2220
Let's presume that we already have our plugin written and it's in a module
23-
called ``flake8_example``. We might have a ``setup.py`` that looks something
24-
like:
21+
:external+packaging:term:`Build Backend`, but be aware that most backends
22+
called ``flake8_example``. We will also assume ``setuptools`` is used as a
23+
:external+packaging:term:`Build Backend`, but be aware that most backends
24+
support entry points.
25+
26+
We might have a ``setup.py`` that looks something like:
2527

2628
.. code-block:: python
2729
@@ -150,5 +152,7 @@ If your plugin is intended to be opt-in, it can set the attribute
150152
:ref:`enable-extensions<option-enable-extensions>` with your plugin's entry
151153
point.
152154

153-
.. _Entry Points:
154-
https://setuptools.readthedocs.io/en/latest/pkg_resources.html#entry-points
155+
.. seealso::
156+
157+
The :external+setuptools:doc:`setuptools user guide <userguide/entry_point>`
158+
about entry points.

0 commit comments

Comments
 (0)