An example python project serving as a reference. (see also this blog series)
This projects comes with a docker-compose
setup and a Makefile
(yes, a Makefile
:D) for executing the most frequent commands:
# building the image
make build
# initialize the database
make setup-db
# starting the api service
make run
# to access the logs
make logs
# executing the tests
make test
It can also be used with vscode
.
To avoid committing and pushing changes that will fail CI because of simple formatting issues, you can install the pre-commit
hooks.
# install pre-commit
pip install --user pre-commit
# install the hooks
pre-commit install
Now whenever you commit changes, checks like black
and mypy
will be run against the edited files.