From 8db4324bc1d1c1833de3aa1fa06babb405f5b019 Mon Sep 17 00:00:00 2001 From: Herrtian <70463940+Herrtian@users.noreply.github.com> Date: Fri, 22 May 2026 19:34:44 +0200 Subject: [PATCH 1/2] Clarify script entry point targets --- source/guides/writing-pyproject-toml.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/guides/writing-pyproject-toml.rst b/source/guides/writing-pyproject-toml.rst index 92a7f25bf..3b19b8a53 100644 --- a/source/guides/writing-pyproject-toml.rst +++ b/source/guides/writing-pyproject-toml.rst @@ -208,6 +208,10 @@ In this example, after installing your project, a ``spam-cli`` command will be available. Executing this command will do the equivalent of ``import sys; from spam import main_cli; sys.exit(main_cli())``. +Script entry points must use the ``module:object`` form. The object +reference should point to a function that can be called with no arguments, +not to a module by itself. + On Windows, scripts packaged this way need a terminal, so if you launch them from within a graphical application, they will make a terminal pop up. To prevent this from happening, use the ``[project.gui-scripts]`` From a8ac4fc4bec7219a0946c73ef264e980b31565b5 Mon Sep 17 00:00:00 2001 From: Herrtian <70463940+Herrtian@users.noreply.github.com> Date: Sat, 6 Jun 2026 14:50:22 +0200 Subject: [PATCH 2/2] Clarify script entry point object references --- source/guides/writing-pyproject-toml.rst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source/guides/writing-pyproject-toml.rst b/source/guides/writing-pyproject-toml.rst index 3b19b8a53..34b368b84 100644 --- a/source/guides/writing-pyproject-toml.rst +++ b/source/guides/writing-pyproject-toml.rst @@ -208,9 +208,10 @@ In this example, after installing your project, a ``spam-cli`` command will be available. Executing this command will do the equivalent of ``import sys; from spam import main_cli; sys.exit(main_cli())``. -Script entry points must use the ``module:object`` form. The object -reference should point to a function that can be called with no arguments, -not to a module by itself. +Script entry points are written as :ref:`object references `, +such as ``importable.module`` or ``importable.module:object.attr``. For +script commands, the object reference should usually point to a callable object +that can be called with no arguments, rather than to a module by itself. On Windows, scripts packaged this way need a terminal, so if you launch them from within a graphical application, they will make a terminal pop