-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
104 lines (90 loc) · 3.22 KB
/
Copy pathMakefile
File metadata and controls
104 lines (90 loc) · 3.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
94
95
96
97
98
99
100
101
102
103
104
UV = uv
HF_HOME = /sgoinfre/sarfreit/hf_cache
FUNCTIONS = data/input/functions_definition.json
INPUT = data/input/function_calling_tests.json
OUTPUT = data/output/function_calling_results.json
export HF_HOME
all: install run
# INSTALL ALL REQUIREMENTS
install:
@if command -v uv >/dev/null 2>&1; then \
echo "✅ uv is already installed ($$(uv --version))"; \
elif [ -f "$$HOME/.local/bin/uv" ]; then \
echo "✅ uv found in $$HOME/.local/bin"; \
else \
echo "📦 uv not found. Installing..."; \
curl -LsSf https://astral.sh/uv/install.sh | sh; \
fi
@echo "📦 Syncing dependencies..."
@PATH="$$HOME/.local/bin:$$PATH" uv sync
@echo "✅ Dependencies ready"
# RUN THE PROGRAM
run:
@$(UV) run python -m src \
--functions_definition $(FUNCTIONS) \
--input $(INPUT) \
--output $(OUTPUT)
run-verbose:
@$(UV) run python -m src \
--functions_definition $(FUNCTIONS) \
--input $(INPUT) \
--output $(OUTPUT) \
--verbose
# DEBUG AND HELP
debug:
@$(UV) run python -m pdb -m src \
--functions_definition $(FUNCTIONS) \
--input $(INPUT) \
--output $(OUTPUT)
help:
@echo ""
@echo "╔══════════════════════════════════════════════════════╗"
@echo "║ Call Me Maybe — Make Commands ║"
@echo "╚══════════════════════════════════════════════════════╝"
@echo ""
@echo " 📦 make install Install project dependencies"
@echo " ▶️ make run Run with default settings"
@echo " 🔍 make run-verbose Run with detailed generation trace"
@echo " 🐞 make debug Run with Python's pdb debugger"
@echo ""
@echo " ✅ make lint Run flake8 and mypy checks"
@echo " 🧠 make lint-strict Run stricter mypy checks"
@echo ""
@echo " 🧹 make clean Remove cache files"
@echo " 💣 make fclean Remove cache + Output files + virtual environment"
@echo " 🔁 make re Full clean and reinstall"
@echo ""
@echo " ℹ️ Program-specific options running with run python -m src ... (--model, --verbose, etc.):"
@echo ""
@$(UV) run python -m src --help
# CHECK FOR NORM ERRORS
lint:
@echo "🔍 Running flake8 and mypy..."
@$(UV) run flake8 .
@$(UV) run mypy . \
--warn-return-any \
--warn-unused-ignores \
--ignore-missing-imports \
--disallow-untyped-defs \
--check-untyped-defs
@echo "✅ Lint completed"
lint-strict:
@echo "🧠 Running strict checks..."
@$(UV) run flake8 .
@$(UV) run mypy . --strict
@echo "✅ Strict lint completed"
# CLEANERS
# CLEANERS
clean:
@echo "\n🧹 Cleaning cache files..."
@find . -type d -name "__pycache__" -exec rm -rf {} +
@find . -type f -name "*.pyc" -delete
@echo "\n🧹 Cleaning generated output..."
@rm -f data/output/*.json
@echo "\n✅ Partial clean complete\n"
fclean: clean
@echo "\n💣 Removing virtual environment..."
@rm -rf .venv
@echo "\n✅ Full clean complete\n"
re: fclean install
.PHONY: all install run debug lint lint-strict clean fclean re