-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
61 lines (47 loc) · 2.23 KB
/
Copy pathMakefile
File metadata and controls
61 lines (47 loc) · 2.23 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
SHELL := /bin/bash
PYTHON ?= python3
.PHONY: help dev-install dev-install-service js-helpers test test-system compile-service-reqs compile-dev-reqs token lint type format validate
help:
@echo "Targets:"
@echo " dev-install Install dev + test extras with uv"
@echo " dev-install-service Install service + test extras with uv"
@echo " js-helpers Install Node deps for Hardhat parser"
@echo " test Run test suite via pytest"
@echo " Pass args with PYTEST_ARGS or ARGS, e.g.:"
@echo " make test PYTEST_ARGS=\"-k unit -v\""
@echo " test-system Run API/worker tests with service dependencies"
@echo " compile-service-reqs Compile pinned requirements for service image (services/requirements.txt)"
@echo " compile-dev-reqs Compile pinned dev/test requirements (requirements-dev.lock)"
@echo " token Generate HMAC token (set HMAC_SHARED_SECRET and REPO_URL)"
@echo " lint Run pylint"
@echo " type Run mypy"
@echo " format Run isort and black formatters"
@echo " validate Run lint, type, and tests"
dev-install:
uv pip install -e '.[dev,test]'
dev-install-service:
uv pip install -e '.[service,test]'
js-helpers:
@which node >/dev/null 2>&1 || { echo "Node.js not found in PATH"; exit 1; }
@which npm >/dev/null 2>&1 || { echo "npm not found in PATH"; exit 1; }
cd gardener/external_helpers/hardhat_config_parser && npm ci --omit=dev
test:
uv run --extra test pytest -q $(PYTEST_ARGS) $(ARGS)
test-system:
uv run --extra service --extra test pytest -q -m system $(PYTEST_ARGS) $(ARGS)
compile-service-reqs:
uv pip compile pyproject.toml -o services/requirements.txt --extra service
compile-dev-reqs:
uv pip compile pyproject.toml -o requirements-dev.lock --extra dev --extra test
token:
@if [ -z "$$HMAC_SHARED_SECRET" ]; then echo "Set HMAC_SHARED_SECRET env var"; exit 1; fi
@if [ -z "$$REPO_URL" ]; then echo "Set REPO_URL env var"; exit 1; fi
$(PYTHON) services/scripts/gen_token.py --url "$$REPO_URL"
lint:
uv run pylint gardener/ services/
type:
uv run mypy gardener/ services/
format:
uv run isort .
uv run black .
validate: lint type test