forked from janushendersonassetallocation/loman
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
72 lines (57 loc) · 2.24 KB
/
Makefile
File metadata and controls
72 lines (57 loc) · 2.24 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
## Makefile for config-templates: developer tasks orchestrated via go-task
#
# This Makefile wraps the Taskfile.yml commands and provides a friendly
# `make help` index. Lines with `##` after a target are parsed into help text,
# and lines starting with `##@` create section headers in the help output.
#
# Colors for pretty output in help messages
BLUE := \033[36m
BOLD := \033[1m
GREEN := \033[32m
RED := \033[31m
RESET := \033[0m
# Default goal when running `make` with no target
.DEFAULT_GOAL := help
# Declare phony targets (they don't produce files)
.PHONY: install-task install clean test marimo book fmt deptry help all
UV_INSTALL_DIR := "./bin"
##@ Bootstrap
install-task: ## ensure go-task (Taskfile) is installed
@mkdir -p ${UV_INSTALL_DIR}
@if [ ! -x "${UV_INSTALL_DIR}/task" ]; then \
printf "$(BLUE)Installing go-task (Taskfile)$(RESET)\n"; \
curl --location https://taskfile.dev/install.sh | sh -s -- -d -b ${UV_INSTALL_DIR}; \
fi
install: install-task ## install
@./bin/task build:install --silent
clean: install-task ## clean
@./bin/task cleanup:clean --silent
##@ Development and Testing
test: install-task ## run all tests
@./bin/task docs:test --silent
marimo: install-task ## fire up Marimo server
@./bin/task docs:marimo --silent
##@ Documentation
book: install-task ## compile the companion book
@./bin/task docs:test --silent
@./bin/task docs:docs --silent
@./bin/task docs:marimushka --silent
@./bin/task docs:book --silent
fmt: install-task ## check the pre-commit hooks and the linting
@./bin/task quality:lint --silent
deptry: install-task ## run deptry if pyproject.toml exists
@if [ -f pyproject.toml ]; then \
./bin/task build:uv --silent; \
echo "→ Running deptry..."; \
./bin/task quality:deptry --silent; \
else \
echo "${GREEN} ⚠ Skipping deptry (no pyproject.toml)"; \
fi
all: fmt deptry test book ## Run everything
echo "Run fmt, deptry, test and book"
##@ Meta
help: ## Display this help message
+@printf "$(BOLD)Usage:$(RESET)\n"
+@printf " make $(BLUE)<target>$(RESET)\n\n"
+@printf "$(BOLD)Targets:$(RESET)\n"
+@awk 'BEGIN {FS = ":.*##"; printf ""} /^[a-zA-Z_-]+:.*?##/ { printf " $(BLUE)%-15s$(RESET) %s\n", $$1, $$2 } /^##@/ { printf "\n$(BOLD)%s$(RESET)\n", substr($$0, 5) }' $(MAKEFILE_LIST)