-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
70 lines (53 loc) · 1.77 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
.DEFAULT_GOAL := help
.PHONY: help
help: ## Show this help.
@grep -E '^\S+:.*?## .*$$' $(firstword $(MAKEFILE_LIST)) | \
awk 'BEGIN {FS = ":.*?## "}; {printf "%-30s %s\n", $$1, $$2}'
.PHONY: local-setup
local-setup: ## Set up the local environment (e.g. install git hooks)
scripts/local-setup.sh
.PHONY: build
build: ## Build the app
docker build . -t weather
.PHONY: install
install: ## Install all dependencies
poetry install
.PHONY: update
update: ## Update dependencies
poetry update
.PHONY: up
up: ## Run the app
docker compose up --build weather
.PHONY: down
down: ## Stop and remove all the Docker services, volumes and networks
docker compose down -v --remove-orphans
.PHONY: dev
dev: ## Run the server in dev mode
poetry run fastapi run --port 8080
.PHONY: check-typing
check-typing: ## Run a static analyzer over the code to find issues
poetry run mypy .
.PHONY: check-format
check-format:
poetry run black --check weather_app
.PHONY: check-style
check-style:
poetry run flake8 weather_app/
poetry run pylint weather_app/**
.PHONY: format
format: ## Format python code
poetry run black weather_app
poetry run pyupgrade --py310-plus **/*.py
.PHONY: test-unit
test-unit: ## Run all unit tests
docker compose run --rm --no-deps weather poetry run pytest -n auto weather_app/tests/unit -ra
.PHONY: test-integration
test-integration: ## Run all integration tests
docker compose run --rm weather poetry run pytest -n auto weather_app/tests/integration -ra
.PHONY: test-acceptance
test-acceptance: ## Run all acceptance tests
docker compose run --rm weather poetry run pytest -n auto weather_app/tests/acceptance -ra
.PHONY: test
test: build test-unit test-integration test-acceptance
.PHONY: pre-commit
pre-commit: check-format check-typing check-style test