summaryrefslogtreecommitdiff
path: root/docs/userguide
diff options
context:
space:
mode:
authorAnderson Bravalheri <andersonbravalheri@gmail.com>2022-03-16 15:51:11 +0000
committerAnderson Bravalheri <andersonbravalheri@gmail.com>2022-03-16 15:51:11 +0000
commita70240af2c4eade71f2900cc0fba9369939b2cd4 (patch)
tree04c260eedf6599056bb0c37061b9ee1086b7cd96 /docs/userguide
parent4d3b445d5a53bda3424aac273e80e51e92a08b2c (diff)
parent02f3821b9af91feadae2326b78a814ac2fbbe520 (diff)
downloadpython-setuptools-git-a70240af2c4eade71f2900cc0fba9369939b2cd4.tar.gz
Merge branch 'main' into experimental/support-pyproject
Diffstat (limited to 'docs/userguide')
-rw-r--r--docs/userguide/entry_point.rst29
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.