-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
93 lines (73 loc) · 2.22 KB
/
Copy pathMakefile
File metadata and controls
93 lines (73 loc) · 2.22 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
82
83
84
85
86
87
88
89
90
91
92
93
# AgentLab top-level Makefile.
#
# Targets are grouped so CI can run a slice (e.g. `make lint-go`) without
# pulling in everything. `make all` runs the full chain locally.
GO ?= go
PY ?= python3
VENV ?= .venv
PIP := $(VENV)/bin/pip
PYBIN := $(VENV)/bin/python
RUFF := $(VENV)/bin/ruff
BLACK := $(VENV)/bin/black
MYPY := $(VENV)/bin/mypy
PYTEST := $(VENV)/bin/pytest
GOLINT := golangci-lint
export PYTHONPATH := $(CURDIR)
export AGENTLAB_HTTP_FIXTURES := $(CURDIR)/tasks/http_fixtures.json
BIN := bin/agentlab
.PHONY: all
all: lint typecheck test build
# ----- environment -----------------------------------------------------------
.PHONY: venv
venv:
$(PY) -m venv $(VENV)
$(PIP) install --upgrade pip
$(PIP) install -e ".[dev]"
.PHONY: deps-go
deps-go:
$(GO) mod download
# ----- build -----------------------------------------------------------------
.PHONY: build
build:
mkdir -p bin
$(GO) build -o $(BIN) ./cmd/agentlab
# ----- lint ------------------------------------------------------------------
.PHONY: lint lint-go lint-py
lint: lint-go lint-py
lint-go:
$(GOLINT) run --timeout 5m ./...
lint-py:
$(RUFF) check .
$(BLACK) --check .
# ----- typecheck -------------------------------------------------------------
.PHONY: typecheck typecheck-go typecheck-py
typecheck: typecheck-go typecheck-py
typecheck-go:
$(GO) vet ./...
typecheck-py:
$(MYPY) .
# ----- test ------------------------------------------------------------------
.PHONY: test test-go test-py test-integration
test: test-go test-py test-integration
test-go:
$(GO) test ./internal/...
test-py:
$(PYTEST) tests/py -q
test-integration: build
$(GO) test ./tests/integration/...
# ----- demo ------------------------------------------------------------------
.PHONY: demo
demo: build
mkdir -p demo-output
./$(BIN) \
--config tasks/agentlab.yaml \
--result-out demo-output/result.json \
--trace-out demo-output/trace.jsonl \
--otel-mode memory
.PHONY: up
up: venv deps-go build
# ----- cleanup ---------------------------------------------------------------
.PHONY: clean
clean:
rm -rf bin demo-output coverage.* .pytest_cache .mypy_cache .ruff_cache
find . -name __pycache__ -type d -prune -exec rm -rf {} +