Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
93 lines (75 loc) · 1.9 KB
/
Copy pathMakefile
File metadata and controls
93 lines (75 loc) · 1.9 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
# Constrained Decoding Agent
# Do not run Makefile commands untill you read
# README.md Installation instructions and
# understand where LLM cache files will be stored
NAME = call_me_maybe
SHELL = /bin/bash
# Toolchain
PYTHON = uv run python
FLAKE8 = uv run flake8
MYPY = uv run mypy
# Directories
SRC_DIR = src
DATA_DIR = data
# Default target
.PHONY: all
all: run
# Installation Rules
.PHONY: install
install:
@if [[ ! -f .install_stamp || pyproject.toml -nt .install_stamp ]]; then \
echo "Installing project dependencies using uv..."; \
uv sync --all-groups; \
touch .install_stamp; \
else \
echo "Nothing to do: everything is already setup."; \
fi
# Execution Rules
.PHONY: run
run: install
@echo "Running Constrained Decoding Agent (FSM ON)..."
$(PYTHON) -m $(SRC_DIR)
.PHONY: run_off
run_off: install
@echo "Running Unconstrained Decoding Agent (FSM OFF)..."
$(PYTHON) -m $(SRC_DIR) --off
# Debugging Mode
.PHONY: debug
debug: install
@echo "Running Constrained Decoding Agent in Debug Mode..."
$(PYTHON) -m pdb -m $(SRC_DIR)
# Validation Rules
.PHONY: lint
lint:
@echo "Running Flake8 (Formatting)..."
$(FLAKE8) $(SRC_DIR)
@echo "Flake8 check completed."
@echo "Running MyPy (Static Type Checking)..."
$(MYPY) $(SRC_DIR) \
--warn-return-any \
--warn-unused-ignores \
--ignore-missing-imports \
--disallow-untyped-defs \
--check-untyped-defs
.PHONY: lint-strict
lint-strict:
@echo "Running Flake8 (Formatting)..."
$(FLAKE8) $(SRC_DIR)
@echo "Flake8 check completed."
@echo "Running MyPy (Strict Static Type Checking)..."
$(MYPY) $(SRC_DIR) --strict
# Cleanup Rules
.PHONY: clean
clean:
@echo "Cleaning cache files..."
rm -rf $(SRC_DIR)/__pycache__
rm -rf .mypy_cache
find . -type d -name "__pycache__" -exec rm -rf {} +
find . -type f -name "*.pyc" -delete
.PHONY: fclean
fclean: clean
@echo "Performing deep clean..."
rm -rf .venv
rm -f .install_stamp
.PHONY: re
re: fclean all