-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
61 lines (41 loc) · 2.1 KB
/
Makefile
File metadata and controls
61 lines (41 loc) · 2.1 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
SHELL := /bin/bash
UV ?= uv
JOBS ?= $(shell python3 -c "import os; print(max(1, os.cpu_count() - 2))")
.DEFAULT_GOAL := help
.PHONY: help install sync convert docs docs-serve docs-clean clean lint oauth-serve oauth-test
help: ## Display this help text
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z0-9_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
##@ Setup
install: ## Install all dependencies
$(UV) sync
##@ Content Pipeline
sync: ## Sync raw HTML from wiki server
./scripts/sync.sh
convert: ## Convert HTML to Markdown (requires sync first)
$(UV) run --group convert python scripts/convert.py --wiki all --raw-dir _raw --out-dir .
##@ Documentation
docs: docs-clean ## Build Sphinx documentation
$(UV) run sphinx-build -b html . _build/html -j $(JOBS) --keep-going
docs-serve: docs-clean ## Serve docs with live reload
$(UV) run sphinx-autobuild . _build/html -j $(JOBS) --port 0 --re-ignore '_raw/.*' --re-ignore '.claude/.*' --re-ignore '.github/.*' --re-ignore 'oauth/.*' --re-ignore '_extra/.*' --re-ignore 'k8s/.*' --re-ignore 'scripts/.*'
docs-serve-fast: docs-clean ## Serve single wiki section (WIKI=python|psf|jython [SECTION=subdir])
ifndef WIKI
$(error Usage: make docs-serve-fast WIKI=python [SECTION=Advocacy])
endif
WIKI=$(WIKI) SECTION=$(SECTION) $(UV) run sphinx-autobuild . _build/html -j $(JOBS) --port 0 --re-ignore '_raw/.*' --re-ignore '.claude/.*'
docs-clean: ## Clean built documentation
rm -rf _build
##@ Code Quality
lint: ## Run pre-commit hooks
$(UV) run prek run --all-files
redirects: ## Regenerate redirect mapping and static HTML files
$(UV) run python scripts/gen_old_wiki_redirects.py
$(UV) run python scripts/gen_redirect_pages.py
##@ OAuth Proxy
oauth-serve: ## Run OAuth proxy locally (set GITHUB_CLIENT_ID and GITHUB_CLIENT_SECRET)
cd oauth && $(UV) run uvicorn app:app --reload --port 8000
oauth-test: ## Run OAuth proxy tests
cd oauth && $(UV) run --group test pytest
##@ Utility
clean: docs-clean ## Clean all build artifacts
rm -rf _raw