diff options
| author | Xing Han Lu <github@xinghanlu.com> | 2022-03-02 12:29:51 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-03-02 12:29:51 -0500 |
| commit | e2ea5d62b12daddd924b3da883bd8e32e585749e (patch) | |
| tree | df012f8bd5c995aad582cbd9c1f393aa4c1be163 /docs/userguide | |
| parent | e30999503add90052a1bbf4526c3025baed947f7 (diff) | |
| download | python-setuptools-git-e2ea5d62b12daddd924b3da883bd8e32e585749e.tar.gz | |
Update entry_point.rst
Diffstat (limited to 'docs/userguide')
| -rw-r--r-- | docs/userguide/entry_point.rst | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/docs/userguide/entry_point.rst b/docs/userguide/entry_point.rst index 21edc697..ea73bb5e 100644 --- a/docs/userguide/entry_point.rst +++ b/docs/userguide/entry_point.rst @@ -54,11 +54,32 @@ above example, to create a command ``hello-world`` that invokes ``timmins.hello_world``, add a console script entry point to ``setup.cfg``: -.. code-block:: ini +.. tab:: setup.cfg + + .. code-block:: ini + + [options.entry_points] + console_scripts = + hello-world = timmins:hello_world + +.. tab:: setup.py + + .. code-block:: python + + from setuptools import setup + + setup( + name='timmins', + version='0.0.1', + packages=['timmins'], + # ... + entry_points={ + 'console_scripts': [ + 'hello-world=timmins:hello_world', + ] + } + ) - [options.entry_points] - console_scripts = - hello-world = timmins:hello_world After installing the package, a user may invoke that function by simply calling ``hello-world`` on the command line. |
