-
Notifications
You must be signed in to change notification settings - Fork 32
/
makefile
68 lines (55 loc) · 1.31 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
.DEFAULT_GOAL := all
sources = src tests
.PHONY: install
install:
poetry install
poetry shell
pre-commit install
.PHONY: run
run:
poetry run python src/server.py
.PHONY: format
format:
poetry run ruff check --fix $(sources)
poetry run ruff format $(sources)
.PHONY: lint
lint:
poetry run ruff check $(sources)
poetry run ruff format --check $(sources)
.PHONY: run_docker
run_docker:
docker compose up -d
.PHONY: test
test:
poetry run pytest
.PHONY: test_docker
test_docker:
docker compose exec flask poetry run pytest
.PHONY: output_coverage
output_coverage:
@rm -rf htmlcov
@mkdir -p htmlcov
poetry run coverage run -m pytest
poetry run coverage report
poetry run coverage html -d htmlcov
.PHONY: output_coverage_docker
output_coverage_docker:
@docker compose exec flask rm -rf htmlcov
@docker compose exec flask mkdir -p htmlcov
docker compose exec flask poetry run coverage run -m pytest
docker compose exec flask poetry run coverage report
docker compose exec flask poetry run coverage html -d htmlcov
.PHONY: send_email
send_email:
poetry run python src/send_email.py
.PHONY: send_email_docker
send_email_docker:
docker compose exec flask poetry run python src/send_email.py
.PHONY: clean
clean:
rm -rf htmlcov
rm -rf .pytest_cache
rm -f .coverage
rm -f .coverage.*
.PHONY: all
all: format lint test