-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
81 lines (63 loc) · 2.27 KB
/
Makefile
File metadata and controls
81 lines (63 loc) · 2.27 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
73
74
75
76
77
78
79
80
81
integration_test_case_targets := integration-test-case1 integration-test-case2 integration-test-case3 integration-test-case5 integration-test-case7
.NOTPARALLEL: all
.PHONY: all
all: check test build
.PHONY: format
format:
uv run ruff format
.PHONY: check-format
check-format:
uv run ruff format --check
.PHONY: check-alembic
check-alembic:
rm -f ktp_controller_alembic_check.sqlite
KTP_CONTROLLER_DB_PATH=ktp_controller_alembic_check.sqlite uv run alembic upgrade head
KTP_CONTROLLER_DB_PATH=ktp_controller_alembic_check.sqlite uv run alembic check
.PHONY: check
check: check-format check-alembic
uv run ruff check
.PHONY: pytest
pytest:
uv run pytest -rA --ignore-glob=tests/integration_test_case*.py --show-capture=all --ff -x --log-level=WARNING --doctest-modules -vv tests/ ktp_controller/
.PHONY: .pytest-integration
.pytest-integration:
test -n "$${KTP_CONTROLLER_INTEGRATION_TEST_CASE:-}"
uv run pytest -rA --show-capture=all -x --log-level=WARNING -vv "tests/integration_test_$${KTP_CONTROLLER_INTEGRATION_TEST_CASE}.py"
.PHONY: test
test:
uv run supervisord -c supervisor/test.conf
@grep -q -x ok chain_result
.PHONY: $(integration_test_case_targets)
$(integration_test_case_targets): integration-test-%:
KTP_CONTROLLER_DOTENV='$(@:%=%.env)' KTP_CONTROLLER_INTEGRATION_TEST_CASE='$(@:integration-test-%=%)' uv run supervisord -c supervisor/integration-test.conf
@grep -q -x ok chain_result
.NOTPARALLEL: integration-test
.PHONY: integration-test
integration-test: $(integration_test_case_targets)
.PHONY: dev-install
dev-install:
command -v uv >/dev/null || { curl -LsSf https://astral.sh/uv/install.sh | sh; }
.PHONY: update-deps
update-deps:
uv lock --upgrade
.PHONY: dry-update-deps
dry-update-deps:
@uv lock --upgrade --dry-run
@wget -q -O- https://github.com/redis/redis/releases/latest | sed -r -n 's|.*<title>Release ([0-9.]+).*$$|Redis available: \1|p'
@sed -r -n 's|^command=docker pull redis:(.*)$$|Redis installed: \1|p' supervisor/test.conf
.PHONY: build-prodbundle
build-prodbundle:
aux/build-prodbundle.sh
.PHONY: build-wheel
build-wheel:
uv build --wheel
.PHONY: build-sdist
build-sdist:
uv build --sdist
.PHONY: build
.NOTPARALLEL: build
build: build-prodbundle build-wheel build-sdist
.PHONY: clean
clean:
git clean -fdx dist/
git clean -fdx '*.sqlite'