-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
72 lines (58 loc) · 1.91 KB
/
Copy pathMakefile
File metadata and controls
72 lines (58 loc) · 1.91 KB
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
71
72
color := $(shell tput setaf 2)
off := $(shell tput sgr0)
PYTHON := $(if $(shell command -v python3),python3,python)
TARGETS = src tests docs
.PHONY: all
all: lint test
.PHONY: lint
lint: format linter typecheck
.PHONY: test
test: docs coverage
.PHONY: coverage
coverage:
# Remove any leftover coverage files before running tests
@uv run coverage combine --quiet > /dev/null || true
@printf '\n\n*****************\n'
@printf '$(color)Running doctest$(off)\n'
@printf '*****************\n'
uv run coverage run --parallel-mode --source chainmock tests/integrations/i_doctest.py
@printf '\n\n*****************\n'
@printf '$(color)Running pytest$(off)\n'
@printf '*****************\n'
uv run coverage run --parallel-mode --source chainmock -m pytest tests/integrations/i_pytest.py
@printf '\n\n*****************\n'
@printf '$(color)Running unittest$(off)\n'
@printf '*****************\n'
PYTHONPATH=./ uv run coverage run --parallel-mode --source chainmock tests/integrations/i_unittest.py 2> /dev/null
@printf '\n\n*****************\n'
@printf '$(color)Test coverage$(off)\n'
@printf '*****************\n'
@uv run coverage combine --quiet
uv run coverage report --fail-under=100 --show-missing
.PHONY: typecheck
typecheck:
@printf '\n\n*****************\n'
@printf '$(color)Running type checker$(off)\n'
@printf '*****************\n'
uv run ty check --error-on-warning ${TARGETS}
.PHONY: format
format:
@printf '\n\n*****************\n'
@printf '$(color)Running format$(off)\n'
@printf '*****************\n'
uv run ruff format --check ${TARGETS}
.PHONY: linter
linter:
@printf '\n\n*****************\n'
@printf '$(color)Running linter$(off)\n'
@printf '*****************\n'
uv run ruff check ${TARGETS}
.PHONY: docs
docs:
@printf '\n\n*****************\n'
@printf '$(color)Test building docs$(off)\n'
@printf '*****************\n'
uv run mkdocs build --strict
.PHONY: serve
serve:
uv run mkdocs serve --open