From 3d466c8e82e818f6613679781135a15ba0ed07a2 Mon Sep 17 00:00:00 2001 From: Ivan Golikov Date: Mon, 13 Jun 2022 00:54:27 +0300 Subject: [PATCH] Running application with special command --- setup.cfg | 5 +++++ src/rectes/__init__.py | 5 +++++ src/rectes/cli.py | 6 ++++++ 3 files changed, 16 insertions(+) create mode 100644 src/rectes/cli.py diff --git a/setup.cfg b/setup.cfg index 384c067..abc8b2d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -8,6 +8,7 @@ packages = find: install_requires = fastapi==0.78.0 aioredis==2.0.1 + click==8.1.3 python_requires = >=3.10 [options.extras_require] @@ -16,5 +17,9 @@ hiredis = development = pre-commit==2.19.0 +[options.entry_points] +console_scripts = + rectes = rectes:cli + [options.packages.find] where = src diff --git a/src/rectes/__init__.py b/src/rectes/__init__.py index e69de29..482ed66 100644 --- a/src/rectes/__init__.py +++ b/src/rectes/__init__.py @@ -0,0 +1,5 @@ +__all__ = [ + "cli", +] + +from .cli import cli diff --git a/src/rectes/cli.py b/src/rectes/cli.py new file mode 100644 index 0000000..bb605b9 --- /dev/null +++ b/src/rectes/cli.py @@ -0,0 +1,6 @@ +import click + + +@click.command() +def cli(): + print("Hello, world")