-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
44 lines (32 loc) · 1.49 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#################################################################################
# GLOBALS #
#################################################################################
-include .envrc
export
PYTHON_INTERPRETER = python3
#################################################################################
# COMMANDS #
#################################################################################
.PHONY: help pre-commit install clean test dev
# Default target executed when no arguments are given to make.
all: help
help: ## Show this help screen.
@grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
pre-commit: ## Runs the pre-commit over entire repo
@poetry run pre-commit run --all-files
define install_dependencies
if ! type "poetry" > /dev/null; then \
pip install poetry; \
fi
poetry config virtualenvs.in-project true
poetry install --sync --with dev
endef
install: ## Install dependencies with Poetry.
@$(call install_dependencies)
clean: ## Delete all Python cache files.
@find . -type d -name "__pycache__" -prune -exec rm -rf {} \; &&\
find . -type d -name ".pytest_cache" -prune -exec rm -rf {} \; &&\
test: ## Run all unit tests locally.
@poetry run python -m pytest -s .
start: ## Run API locally.
@poetry run python -m uvicorn canary.src.main:app --reload