File tree 3 files changed +23
-16
lines changed
3 files changed +23
-16
lines changed Original file line number Diff line number Diff line change 296
296
297
297
298
298
# 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
+ }
300
304
301
305
extlinks = {
302
306
"issue" : ("https://github.com/pycqa/flake8/issues/%s" , "#%s" ),
Original file line number Diff line number Diff line change @@ -30,7 +30,8 @@ To get started writing a |Flake8| :term:`plugin` you first need:
30
30
31
31
Once you've gathered these things, you can get started.
32
32
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
34
35
section we cover:
35
36
36
37
- 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:
54
55
<iframe src =" https://www.youtube.com/embed/ot5Z4KQPBL8" frameborder =" 0" allowfullscreen style =" position : absolute ; top : 0 ; left : 0 ; width : 100% ; height : 100% ;" ></iframe >
55
56
</div >
56
57
58
+ Detailed Plugin Development Documentation
59
+ =========================================
57
60
58
61
.. toctree ::
59
62
:caption: Plugin Developer Documentation
@@ -62,7 +65,3 @@ Here's a tutorial which goes over building an ast checking plugin from scratch:
62
65
registering-plugins
63
66
plugin-parameters
64
67
formatters
65
-
66
-
67
- .. _entry points :
68
- https://setuptools.readthedocs.io/en/latest/pkg_resources.html#entry-points
Original file line number Diff line number Diff line change @@ -12,16 +12,18 @@ To register any kind of plugin with |Flake8|, you need:
12
12
13
13
#. A name for your plugin that will (ideally) be unique.
14
14
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.
21
19
22
20
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:
25
27
26
28
.. code-block :: python
27
29
@@ -150,5 +152,7 @@ If your plugin is intended to be opt-in, it can set the attribute
150
152
:ref: `enable-extensions<option-enable-extensions> ` with your plugin's entry
151
153
point.
152
154
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.
You can’t perform that action at this time.
0 commit comments