@@ -24,44 +24,51 @@ Task plugin class
2424 implementation of the :file: `process ` method.
2525
2626Task plugin entry point
27- Registration of the plugin must be done in :file: `setup.py `
28- using the ``entry_points `` concept from Python's setuptools .
27+ Registration of the plugin must be done in :file: `pyproject.toml `
28+ using the ``tool.poetry.plugins `` concept.
2929
3030 .. code :: python
3131
32- ' packages' : [' kiwi_plugin' ],
33- ' entry_points' : {
34- ' kiwi.tasks' : [
35- ' service_command=kiwi_plugin.tasks.service_command'
36- ]
37- }
32+ [tool.poetry]
33+ name = " kiwi_plugin"
34+
35+ packages = [
36+ { include = " kiwi_plugin" },
37+ ]
38+
39+ [tool.poetry.plugins]
40+ [tool.poetry.plugins." kiwi.tasks" ]
41+ service_command = " kiwi_plugin.tasks.service_command"
3842
3943 Example plugin
4044--------------
4145
4246.. note ::
4347
4448 The following example assumes an existing Python project
45- which was set up according to the Python project rules
46- and standards.
49+ which was set up using poetry and pyproject.toml.
4750
48511. Assuming the project namespace is **kiwi_relax_plugin **, create the task
4952 plugin directory :file: `kiwi_relax_plugin/tasks `
5053
51- 2. Create the entry point in :command: `setup.py `.
54+ 2. Create the entry point in :command: `pyproject.toml `.
5255
5356 Assuming we want to create the service named **relax ** that has
54- the command **justdoit **, this is the following entry point
55- definition in :file: `setup.py `:
57+ the command **justdoit **, this is the required plugin
58+ definition in :file: `pyproject.toml `:
5659
5760 .. code :: python
5861
59- ' packages' : [' kiwi_relax_plugin' ],
60- ' entry_points' : {
61- ' kiwi.tasks' : [
62- ' relax_justdoit=kiwi_relax_plugin.tasks.relax_justdoit'
63- ]
64- }
62+ [tool.poetry]
63+ name = " kiwi_relax_plugin"
64+
65+ packages = [
66+ { include = " kiwi_relax_plugin" },
67+ ]
68+
69+ [tool.poetry.plugins]
70+ [tool.poetry.plugins." kiwi.tasks" ]
71+ relax_justdoit = " kiwi_relax_plugin.tasks.relax_justdoit"
6572
6673 3. Create the plugin code in the file
6774 :file: `kiwi_relax_plugin/tasks/relax_justdoit.py ` with the following
@@ -106,5 +113,4 @@ Example plugin
106113
107114 .. code :: bash
108115
109- $ ./setup.py develop
110- $ kiwi-ng relax justdoit --now
116+ $ poetry run kiwi-ng relax justdoit --now
0 commit comments