33.DEFAULT_GOAL =help
44
55# Define commands to be explicitly invoked
6- .PHONY : all venv install check clean help run migrate hello
6+ .PHONY : help hello venv install migrate check run clean
77
88# Define the name of the virtual environment directory
99VENV_DIR = .venv
@@ -26,28 +26,34 @@ UVICORN = $(VENV_DIR)/bin/uvicorn
2626# Define the alembic executable within the virtual environment
2727ALEMBIC = $(VENV_DIR ) /bin/alembic
2828
29+ help : # # Show this help
30+ @egrep -h ' \s##\s' $(MAKEFILE_LIST ) | sort | awk ' BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
31+
2932hello : # # Hello, World!
3033 @echo " Hello, World!"
3134
32- # Setup the development environment
33- all : venv install check
34-
3535venv : # # Create a virtual environment
3636 $(PYTHON ) -m venv $(VENV_DIR )
3737 @echo " Virtual environment created."
3838
39- install : # # Install development packages
39+ install : # # Install development dependencies
4040 $(PIP ) install --upgrade pip
4141 $(PIP ) install -r requirements.txt
4242 $(PRE_COMMIT ) install
4343 cp .env.example .env
44- @echo " Development packages has been setup."
44+ @echo " Development dependencies has been setup."
45+
46+ migrate : # # Run the database migration
47+ $(ALEMBIC ) upgrade head
4548
4649check : # # Run all checks using tox and pre-commit
4750 $(TOX )
4851 $(PRE_COMMIT ) run --all-files
4952 @echo " All checks passed"
5053
54+ run : # # Run the development server
55+ $(UVICORN ) main:app --reload
56+
5157clean : # # Clean up the project of unneeded files
5258 @echo " Cleaning up the project of unneeded files..."
5359 @rm -rf $(VENV_DIR )
@@ -61,13 +67,3 @@ clean: ## Clean up the project of unneeded files
6167 @find . -name " *.pyc" -delete
6268 @find . -type d -name " __pycache__" -exec rm -r {} +
6369 @echo " Clean up successfully completed."
64-
65- help : # # Show this help
66- @egrep -h ' \s##\s' $(MAKEFILE_LIST ) | sort | awk ' BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
67-
68- run : # # Run the development server
69- $(UVICORN ) main:app --reload
70-
71- migrate : # # Run the database migration
72- $(ALEMBIC ) revision --autogenerate
73- $(ALEMBIC ) upgrade head
0 commit comments