Makefile¶
The project includes a Makefile to help automate some tasks. These tasks can be grouped into sections.
System Dependencies¶
To check if you have all the required tools:
Project Dependencies¶
Tasks that help you set up your environment (create a virtual environment, install packages and tools…)
install¶
This will should be the first command to prepare your environment. It will set up several things:
-
create a
.python-versionfile, that will telluvwhich python version to use. Behind the scenes, it will look at the python version you select during project generation (which is stored in the variablePYTHON_VERSIONon your Makefile), and will search for the latest version available and use it -
uvwill use this version and create your virtual environment on the project root (.venvfolder), and then install the project dependencies -
if there’s no git initialization in the project, it will perform a
git init, if there is, it will be skipped -
next, it will install the
pre-commithooks and install the git message template
install-jupyter¶
Install the dependencies to run jupyter notebooks. This target is only available if selected in the project setup
(include_notebooks).
install-docs¶
Install the dependencies to build documentation. This target is only available if selected in the project setup
(include_docs).
requirements.txt¶
This will update/generate the project requirements.txt, based on the installed dependencies from uv.
Checks¶
Tasks to run linters, formatters and python dependencies vulnerabilities scanner
format¶
Runs all formatters: sqlfluff (SQL) and ruff(fix-only) on your src and tests directory.
You can also run each check individually: make format-sqlfluff or make format-ruff.
check-packages¶
Runs checks on packages:
- Checks the validity of the
pyproject.tomlfile - Verify installed packages have compatible dependencies
- Run
safety checkto find vulnerabilities in Python dependencies
lint¶
Runs sqlfluff, mypy and ruff on your src and tests directory, and shellcheck on shell files.
You can also run each check individually: make lint-mypy, make lint-ruff or make lint-shellcheck.
check¶
Runs both check-packages and lint targets.
pre-commit¶
Runs the pre-commit checks on all files.
Tests¶
Tasks related to testing.
test¶
Runs the tests with pytest. As we’re using pytest-randomly to shuffle the tests, if the last run of the tests fails,
it will run the test with the same random seed first, and then, if the tests pass, it will run with a new one.
read-coverage¶
Opens the coverage report for the last pytest run.
Documentation¶
Tasks related to documentation. This section is only available if selected in the project setup (include_docs).
build-docs¶
Generate mkdocs documentation locally.
The first this target is executed, it will run the target install-docs before.
docs¶
Build docs and serve them.
Build¶
Tasks related to builds.
dist¶
Builds the package, as a tarball and a wheel.
Cleanup¶
Tasks to clean up.
clean¶
Delete all generated and temporary files.
clean-all¶
Delete the virtual environment and all generated and temporary files.
Docker¶
Tasks related to docker. This section is only available if selected in the project setup (include_docker).
build-docker¶
Build the docker image.
run-docker¶
Run the docker container for the built image.
Other Tasks¶
ci¶
Run targets format, check, test and build-docs (if selected)
jupyter¶
Run jupyter notebooks on the notebooks directory (it will be created if it doesn’t exist).
The first this target is executed, it will run the target install-jupyter before.