-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
164 lines (128 loc) · 4.08 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
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
# ================================================
# MARK: Dev commands
# ================================================
.PHONY: install
install:
uv pip install -e .
.PHONY: install-dev
install-dev:
uv pip install -e ".[dev]"
.PHONY: install-docs
install-docs:
uv pip install -e ".[docs]"
.PHONY: install-all
install-all:
uv pip install -e ".[dev,examples,docs]"
.PHONY: format
format:
uv run ruff format .
uv run ruff check . --fix
.PHONY: lint
lint:
uv run ruff check .
uv run mypy .
.PHONY: mypy
mypy:
uv run mypy .
.PHONY: test
test:
uv run pytest -v -s
# ================================================
# MARK: Commitizen commands
# ================================================
.PHONY: commit
commit:
uv run cz commit
.PHONY: bump
bump:
uv run cz bump
.PHONY: changelog
changelog:
uv run cz changelog
.PHONY: release
release:
# Ensure everything is clean and tested
make lint
make test
# Update version and changelog
uv run cz bump --changelog
# Push changes
git push
git push --tags
# ================================================
# MARK: Example runners
# ================================================
.PHONY: run-basics-tools-without-context-example
run-basics-tools-without-context-example:
python -m examples.basics.tools_without_context.run
.PHONY: run-basics-tools-with-context-example
run-basics-tools-with-context-example:
python -m examples.basics.tools_with_context.run
.PHONY: run-basics-agent-switching-example
run-basics-agent-switching-example:
python -m examples.basics.agent_switching.run
.PHONY: run-basics-instruction-builder-example
run-basics-instruction-builder-example:
python -m examples.basics.instruction_builder.run
.PHONY: run-basics-tools-return-values-example
run-basics-tools-return-values-example:
python -m examples.basics.tools_return_values.run
.PHONY: run-basics-chat-intro-example
run-basics-chat-intro-example:
python -m examples.basics.chat_intro.run
.PHONY: run-basics-structured-outputs-core-example
run-basics-structured-outputs-core-example:
python -m examples.basics.structured_outputs_core.run
.PHONY: run-basics-structured-outputs-chat-example
run-basics-structured-outputs-chat-example:
python -m examples.basics.structured_outputs_chat.run
.PHONY: run-basics-repl-with-swarm-example
run-basics-repl-with-swarm-example:
python -m examples.basics.repl_with_swarm.run
.PHONY: run-basics-parallel-tool-calls-example
run-basics-parallel-tool-calls-example:
python -m examples.basics.parallel_tool_calls.run
.PHONY: run-advanced-mobile-dev-team-example
run-advanced-mobile-dev-team-example:
python -m examples.advanced.mobile_dev_team.run
.PHONY: run-advanced-agent-team-example
run-advanced-agent-team-example:
python -m examples.advanced.agent_team.run
.PHONY: run-advanced-structured-outputs-example
run-advanced-structured-outputs-example:
python -m examples.advanced.structured_outputs.run
.PHONY: run-advanced-chat-app-server-example
run-advanced-chat-app-server-example:
python -m examples.advanced.chat_app_server.run
.PHONY: run-advanced-chat-app-client-example
run-advanced-chat-app-client-example:
python -m examples.advanced.chat_app_client.run
# ================================================
# MARK: PR utility commands
# ================================================
.PHONY: save-pr-diff
save-pr-diff:
@[ -n "$(PR)" ] || (echo "Error: PR is not set"; exit 1)
@echo "Saving diff for PR=$(PR)"
gh pr diff $(PR) > pr$(PR)_diff.patch
.PHONY: save-pr-commit-messages
save-pr-commit-messages:
@[ -n "$(PR)" ] || (echo "Error: PR is not set"; exit 1)
@echo "Saving commit messages for PR=$(PR)"
gh pr view $(PR) --json commits --jq '.commits[] | "\(.messageHeadline) \(.messageBody)"' > pr$(PR)_commit_messages.txt
# ================================================
# MARK: Documentation commands
# ================================================
.PHONY: docs-serve
docs-serve:
@echo "Starting documentation server..."
@pkill -f "mkdocs serve" || true
@mkdocs serve
.PHONY: docs-build
docs-build:
@echo "Building documentation..."
@mkdocs build
.PHONY: docs-clean
docs-clean:
@echo "Cleaning documentation..."
@rm -rf site/