-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
69 lines (50 loc) · 2.2 KB
/
Makefile
File metadata and controls
69 lines (50 loc) · 2.2 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
.PHONY: help install install-tools sync test lint check-compat security format clean all pre-commit-install pre-commit-run generate-licenses check-licenses
# Default target
help: ## Show this help message
@echo "Available targets:"
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}'
# Installation targets
install: ## Install project dependencies
uv sync
install-tools: ## Install development tools
uv tool install ruff
uv tool install vermin
uv tool install pre-commit --with pre-commit-uv
uv tool install licensecheck
sync: install ## Alias for install
setup: install install-tools ## Complete development setup (install deps + tools)
# Development targets
test: ## Run tests
uv run pytest
lint: ## Run linting checks
uv tool run ruff check .
format: ## Format code with ruff
uv tool run ruff check --fix .
uv tool run ruff format .
check-format: ## Check if code is formatted correctly
uv tool run ruff format --check .
check-compat: ## Check Python 3.11 compatibility
uv tool run vermin --target=3.11- --no-tips --violations .
security: ## Check for security vulnerabilities
uv run pip-audit .
generate-licenses: ## Generate licenses
uv tool run licensecheck --license MIT \
--format markdown --file THIRD_PARTY_NOTICES.md
check-licenses: ## Check for licenses
uv tool run licensecheck --license MIT --show-only-failing --zero
# Pre-commit targets
pre-commit-install: ## Install pre-commit hooks
pre-commit install
pre-commit-run: ## Run pre-commit on all files
pre-commit run --all-files
# Combined targets
check: lint check-format check-compat security check-licenses ## Run all checks (lint, format, compatibility, security)
all: format check test ## Format, check, and test
# CI simulation
ci: check test ## Run the same checks as CI
clean: ## Clean up build artifacts and caches
find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true
find . -type d -name "*.egg-info" -exec rm -rf {} + 2>/dev/null || true
find . -type d -name ".pytest_cache" -exec rm -rf {} + 2>/dev/null || true
find . -type d -name ".ruff_cache" -exec rm -rf {} + 2>/dev/null || true
rm -rf build/ dist/ .coverage htmlcov/