Skip to content

Commit 49f52a8

Browse files
committed
Update documentation regarding entry points
Refer to the PyPA packaging guide Replace references to the deprecated `pkg_resources` docs
1 parent 5c52d75 commit 49f52a8

File tree

3 files changed

+18
-16
lines changed

3 files changed

+18
-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

+2-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:doc:`entry points<specifications/entry-points>`. In this
3435
section we cover:
3536

3637
- How to register your plugin so |Flake8| can find it
@@ -62,7 +63,3 @@ Here's a tutorial which goes over building an ast checking plugin from scratch:
6263
registering-plugins
6364
plugin-parameters
6465
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

+11-10
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,15 @@ 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:doc:`entry points<specifications/entry-points>`. These allow
17+
any package to register a plugin with |Flake8| via that package's metadata.
2118

2219
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:
20+
called ``flake8_example``. We will also assume ``setuptools`` is used as a
21+
:term:`Build Backend`, but be aware that most backends support entry points.
22+
23+
We might have a ``setup.py`` that looks something like:
2524

2625
.. code-block:: python
2726
@@ -150,5 +149,7 @@ If your plugin is intended to be opt-in, it can set the attribute
150149
:ref:`enable-extensions<option-enable-extensions>` with your plugin's entry
151150
point.
152151

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

0 commit comments

Comments
 (0)