-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
57 lines (42 loc) · 1.26 KB
/
Makefile
File metadata and controls
57 lines (42 loc) · 1.26 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
UV ?= uv
STLITE_VER ?= 0.86.0
PORT ?= 8000
APP_PY := app.py
SOURCE := src/epicc
DIST_DIR := dist
.DEFAULT_GOAL := help
.PHONY: help
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \
awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}'
.PHONY: setup
setup: install build ## Install dependencies and build the stlite app
.PHONY: install
install: ## Install Python dependencies with uv
$(UV) sync
.PHONY: build
build: $(DIST_DIR) ## Generate the bundle.
mkdir -p $(DIST_DIR)
$(UV) run scripts/build.py --app $(APP_PY) --out $(DIST_DIR)
.PHONY: serve
serve: build ## Serve the stlite static build
$(UV) run python -m http.server $(PORT) --directory $(DIST_DIR)
.PHONY: dev
dev: ## Run normal Streamlit locally
$(UV) run streamlit run $(APP_PY)
.PHONY: stlite
stlite: setup serve ## Install, build, and serve the stlite app
.PHONY: lint
lint: ## Run ruff linter
$(UV) run -m ruff check $(SOURCE)
.PHONY: typecheck
typecheck: ## Run mypy type checker
$(UV) run -m mypy --check-untyped-defs $(SOURCE)
.PHONY: test
test: ## Run pytest
$(UV) run -m pytest
.PHONY: check
check: lint typecheck test ## Run all quality checks
.PHONY: clean
clean: ## Remove build artifacts
rm -rf $(DIST_DIR) .mypy_cache .ruff_cache .pytest_cache __pycache__