diff options
author | Saniya Maheshwari <saniya.mah@gmail.com> | 2022-06-09 00:28:17 +0530 |
---|---|---|
committer | Saniya Maheshwari <saniya.mah@gmail.com> | 2022-06-09 14:31:06 +0530 |
commit | c005bff3b1478234b59119b5cc43d7da93c5a422 (patch) | |
tree | dc47bd07481103986061cd3906c52ee162c3f2fa /docs/userguide | |
parent | 09f364540767212e23bc8262efe179cae70a57fb (diff) | |
download | python-setuptools-git-c005bff3b1478234b59119b5cc43d7da93c5a422.tar.gz |
Elaborated on the 'wrapper script' part
Removed a line stating that installers like Pip create wrapper scripts
around the function, and replaced it with a longer note at the end of
the GUI scripts section. This note includes a sample wrapper script
taken from the Python Packaging user guide. I think this longer note
along with an actual example of how the wrapper script might look like
will make it more clear to the user how console/GUI scripts work behind
the scenes.
Diffstat (limited to 'docs/userguide')
-rw-r--r-- | docs/userguide/entry_point.rst | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/docs/userguide/entry_point.rst b/docs/userguide/entry_point.rst index f2dd7863..568132cc 100644 --- a/docs/userguide/entry_point.rst +++ b/docs/userguide/entry_point.rst @@ -49,11 +49,10 @@ After installing the package, the function may be invoked through the Hello world Adding a console script entry point allows the package to define a -user-friendly name for installers of the package to execute. Installers -like pip will create wrapper scripts to execute a function. In the -above example, to create a command ``hello-world`` that invokes -``timmins.hello_world``, add a console script entry point to -your configuration: +user-friendly name for installers of the package to execute. +In the above example, to create a command ``hello-world`` that invokes +``timmins.hello_world``, add a console script entry point to your +configuration: .. tab:: setup.cfg @@ -170,6 +169,19 @@ will open a small application window with the title 'Hello world'. cannot use standard streams unless application code redirects them. Other platforms do not have the same distinction. +.. note:: + + Console and GUI scripts work because behind the scenes, installers like Pip + create wrapper scripts around the function(s) being invoked. For example, + the ``hello-world`` entry point in the above two examples would create a + command ``hello-world`` launching a script like this: [#packaging_guide]_ + + .. code-block:: python + + import sys + from timmins import hello_world + sys.exit(hello_world()) + .. _dynamic discovery of services and plugins: Advertising Behavior |