-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
92 lines (68 loc) · 3.01 KB
/
Copy pathMakefile
File metadata and controls
92 lines (68 loc) · 3.01 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
SHELL := /bin/bash
UV := uv
PYPROJECT := pyproject.toml
VENV_DIR := .venv
.PHONY: docs openapi-schema all clean test install pre-commit pre-commit-run pre-commit-update
help: ## Show this help message
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-22s\033[0m %s\n", $$1, $$2}'
venv: ## Create virtual environment if missing
@if [ ! -d "$(VENV_DIR)" ]; then \
echo "Creating virtual environment..."; \
$(UV) venv; \
else \
echo "Virtual environment already exists at $(VENV_DIR)"; \
fi
install: venv ## Install base dependencies (Patcher only)
$(UV) sync
dev: venv ## Install everything for monorepo development (Patcher + API + all extras)
$(UV) sync --all-packages --all-extras
uninstall: ## Remove the .venv directory
rm -rf $(VENV_DIR)
clean: ## Remove caches, build artifacts, and the .venv
find . -type d -name __pycache__ -exec rm -rf {} +
find . -type d -name .pytest_cache -exec rm -rf {} +
find . -type d -name .ruff_cache -exec rm -rf {} +
find . -type d -name "*.egg-info" -exec rm -rf {} +
rm -rf .venv coverage/ dist/ build/ .coverage htmlcov/ docs/_build/
lint: ## Check code style with ruff
$(UV) run ruff format --check .
$(UV) run ruff check .
format: ## Auto-format code with ruff
$(UV) run ruff format .
$(UV) run ruff check . --fix
lock: ## Update uv.lock
$(UV) lock
upgrade: ## Upgrade all dependencies to latest versions
$(UV) lock --upgrade
$(UV) sync --all-packages --all-extras
test: ## Run Patcher unit tests (excludes integration)
$(UV) run pytest tests/ -v -m "not integration"
test-integration: ## Run Patcher integration tests only
$(UV) run pytest tests/ -v -m integration
smoke-test: ## Hand-run smoke check of PatcherClient against a live Jamf instance
$(UV) run python tests/integration/smoke.py
test-api: ## Run Patcher API tests
cd api && $(UV) run pytest
serve-api: ## Run Patcher API locally with hot-reload
cd api && $(UV) run uvicorn patcher_api.main:app --reload
pre-commit: ## Install pre-commit hooks
@if [ ! -d "$(VENV_DIR)" ]; then \
echo "Virtual environment not found. Creating and installing dev dependencies..."; \
$(MAKE) dev; \
fi
$(UV) run pre-commit install
pre-commit-run: ## Run pre-commit on all files
$(UV) run pre-commit run --all-files
pre-commit-update: ## Update pre-commit hooks to latest versions
$(UV) run pre-commit autoupdate
build: ## Build distribution packages (sdist + wheel)
$(UV) build --sdist --wheel
docs: openapi-schema ## Build Sphinx documentation
$(UV) run sphinx-build -b html docs/ docs/_build/
openapi-schema: ## Regenerate docs/_generated/openapi.json from FastAPI app
$(UV) run python api/scripts/generate_openapi.py
init-vendor-docs: ## One-time after clone - pull submodule content
git submodule update --init --recursive
update-vendor-docs: ## Refresh vendor docs to latest upstream (Installomator/Autopkg Wikis)
git submodule update --remote --merge
@echo "Don't forget to commit the submodule bump if you want to share the new state."