From 03102cb281377b95eeb18e48339c77df83e00c03 Mon Sep 17 00:00:00 2001 From: ProgrammerFS Date: Tue, 20 Sep 2022 16:48:43 +0400 Subject: [PATCH] Added functionality to list commands --- create_aio_app/main.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/create_aio_app/main.py b/create_aio_app/main.py index 319b5c8a..72603895 100644 --- a/create_aio_app/main.py +++ b/create_aio_app/main.py @@ -16,9 +16,30 @@ def show_commands(folder): + try: os.chdir(f"{folder}/") # nosec os.system("make help") # nosec + echo(click.style("Common commands", fg="bright_blue")) + echo(click.style("make run (make) : Start the development server", fg = "bright_green")) + echo(click.style("make stop : Stop docker containers", fg = "bright_green")) + echo(click.style("make clean : Clean up of docker containers", fg = "bright_green")) + echo(click.style("make bash : Interactive shell inside the running container (the command can be executed only if the server is running e.g. after make run)", fg = "bright_green")) + echo(click.style("make upgrade : Upgrade dependencies", fg = "bright_green")) + echo(click.style("Testing commands", fg="bright_blue")) + echo(click.style("make test : Run the pytest suite inside docker", fg = "bright_green")) + echo(click.style("make mypy : Run mypy for type checking", fg = "bright_green")) + echo(click.style("make black : Run black code formatter", fg = "bright_green")) + echo(click.style("make lint : Run flake8 (click.style(All the settings for flake8 can be customized in .flake8 file)", fg = "bright_green")) + echo(click.style("make profile : Run py-spy sampling profiler. It defaults to 60 seconds. Can be change by adding the TIME variable. eg make profile TIME=30", fg = "bright_green")) + echo(click.style("Database commands", fg="bright_blue")) + echo(click.style("make migrations : Generate a new migration", fg = "bright_green")) + echo(click.style("make migrate : Apply migrations", fg = "bright_green")) + echo(click.style("make psql : Connect to the postgres inside running container", fg = "bright_green")) + echo(click.style("Other commands", fg="bright_blue")) + echo(click.style("make doc : Generate a sphinx documentation", fg = "bright_green")) + + except Exception as e: echo(f'{e}') echo(click.style("\nFailed to show commands\n", fg="red",))