-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathMakefile
38 lines (29 loc) · 1018 Bytes
/
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
.DEFAULT_GOAL := help
.PHONY: venv install fmt clean help test jupyter book
venv:
curl -LsSf https://astral.sh/uv/install.sh | sh
uv venv --python='3.12'
install: venv ## Install dependencies and setup environment
uv pip install --upgrade pip
uv pip install --no-cache-dir -r requirements.txt
fmt: venv ## Format and lint code
uv pip install pre-commit
uv run pre-commit install
uv run pre-commit run --all-files
clean: ## Clean build artifacts and stale branches
git clean -X -d -f
git branch -v | grep "\[gone\]" | cut -f 3 -d ' ' | xargs git branch -D
help: ## Show this help message
@echo "Usage: make [target]"
@echo ""
@echo "Targets:"
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf " %-15s %s\n", $$1, $$2}' $(MAKEFILE_LIST)
.PHONY: jupyter
jupyter: install ## Run jupyter lab
uv pip install jupyterlab
uv run jupyter lab
.PHONY: book
book: install ## Compile the book
uv pip install jupyterlab jupyter-book
uv run jupyter-book clean book
uv run jupyter-book build book