From f8ccb80aef57f094977deeb7d9406417a086bd14 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Mon, 3 Aug 2026 15:08:33 +0300 Subject: [PATCH] Merge pull request #14810 from atiqur-rahman-pro/docs/pyproject-entry-points-10721 doc: add pyproject.toml entry-point example to plugin documentation (fixes #10721) (cherry picked from commit bf2ca20b6ff0b98438edbe8496a622853c2dc2a7) --- changelog/10721.doc.rst | 1 + doc/en/how-to/writing_plugins.rst | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 changelog/10721.doc.rst diff --git a/changelog/10721.doc.rst b/changelog/10721.doc.rst new file mode 100644 index 00000000000..345dc98d8e3 --- /dev/null +++ b/changelog/10721.doc.rst @@ -0,0 +1 @@ +Replaced ``setup.py`` usage with ``pyproject.toml`` in :ref:`writing-plugins`. diff --git a/doc/en/how-to/writing_plugins.rst b/doc/en/how-to/writing_plugins.rst index 56043a14f97..0e112a0ac88 100644 --- a/doc/en/how-to/writing_plugins.rst +++ b/doc/en/how-to/writing_plugins.rst @@ -212,11 +212,12 @@ as plugins. As an example consider the following package:: pytest_foo/plugin.py pytest_foo/helper.py -With the following typical ``setup.py`` extract: +With the following typical ``pyproject.toml`` extract: -.. code-block:: python +.. code-block:: toml - setup(..., entry_points={"pytest11": ["foo = pytest_foo.plugin"]}, ...) + [project.entry-points.pytest11] + foo = "pytest_foo.plugin" In this case only ``pytest_foo/plugin.py`` will be rewritten. If the helper module also contains assert statements which need to be