Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added functionality to list commands #310

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions create_aio_app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",))
Expand Down