-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
94 lines (69 loc) · 2.32 KB
/
Makefile
File metadata and controls
94 lines (69 loc) · 2.32 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
#!/usr/bin/make -f
# -*- makefile -*-
SHELL := /bin/bash
.SHELLFLAGS := -eu -o pipefail -c
.DEFAULT_GOAL := help
.LOGGING := 0
.ONESHELL: ; # Recipes execute in same shell
.NOTPARALLEL: ; # Wait for this target to finish
.SILENT: ; # No need for @
.EXPORT_ALL_VARIABLES: ; # Export variables to child processes.
.DELETE_ON_ERROR: ; # Delete target if recipe fails.
# Modify the block character to be `-\t` instead of `\t`
ifeq ($(origin .RECIPEPREFIX), undefined)
$(error This version of Make does not support .RECIPEPREFIX.)
endif
.RECIPEPREFIX = -
PROJECT_DIR := $(shell git rev-parse --show-toplevel)
SRC_DIR := $(PROJECT_DIR)/src
BUILD_DIR := $(PROJECT_DIR)/dist
default: $(.DEFAULT_GOAL)
all: help
.PHONY: help
help: ## List commands <default>
- echo -e "USAGE: make \033[36m[COMMAND]\033[0m\n"
- echo "Available commands:"
- awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\t\033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
.PHONY: lint
lint: ## Lint the code
- black $(PROJECT_DIR)
- ruff check $(PROJECT_DIR) --fix
.PHONY: serve
serve: build ## Serve the site locally
- @echo "Serving site at http://localhost:8000"
- @echo "Press Ctrl+C to stop"
- cd ./reports/ && python -m http.server 8000
.PHONY: install
install: ## Install dependencies (if needed)
- pip install -e .
.PHONY: build
build: ## Build the database, HTML page, and chart page
- benchci compat
- benchci build-pages
- benchci build-charts
- benchci build-spider-chart
# .PHONY: build
# build: ## Build the application
# - pip install wheel
# - pip install --upgrade pip wheel
# - pip install --editable ".[developer]"
# - hatch build --clean --target wheel
.PHONY: clean
clean: ## Clean generated files
- rm -f docs/database.json
- rm -f docs/report.css
- @echo "Cleaned generated files"
.PHONY: eval
eval: ## Run evaluations (if needed)
- benchci evaluate
.PHONY: clean-logs
clean-logs: ## Clean log files
- @echo "Cleaning log files..."
- grep -rnil "BadRequestError" ./logs/ | xargs -r rm -f
- grep -rnil "AuthenticationError" ./logs/ | xargs -r rm -f
- grep -rnil "OpenRouterError" ./logs/ | xargs -r rm -f
- grep -rnil "JSONDecodeError" ./logs/ | xargs -r rm -f
.PHONY: backup
backup: ## Backup the database
- @echo "Backing up database..."
- cp -rf ./logs/* ./.originals/