-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
76 lines (58 loc) · 2.89 KB
/
Makefile
File metadata and controls
76 lines (58 loc) · 2.89 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
.PHONY: install format lint test clean check-types check-format check-sort-imports sort-imports build docs-build docs-serve help
.DEFAULT_GOAL := help
# Allow passing arguments to make targets (e.g., make test ARGS="...")
ARGS ?=
install: ## Install the project and all dependencies
@echo "🚀 Installing project dependencies with uv"
uv sync
format: ## Format code with isort and black
@echo "🎨 Formatting code"
uv run isort ./sql_redis ./tests/ --profile black
uv run black ./sql_redis ./tests/
check-format: ## Check code formatting
@echo "🔍 Checking code formatting"
uv run black --check ./sql_redis ./tests/
sort-imports: ## Sort imports with isort
@echo "📦 Sorting imports"
uv run isort ./sql_redis ./tests/ --profile black
check-sort-imports: ## Check import sorting
@echo "🔍 Checking import sorting"
uv run isort ./sql_redis ./tests/ --check-only --profile black
check-types: ## Run mypy type checking
@echo "🔍 Running mypy type checking"
uv run python -m mypy ./sql_redis
lint: format check-types ## Run all linting (format + type check)
test: ## Run tests (pass extra args with ARGS="...")
@echo "🧪 Running tests"
uv run python -m pytest $(ARGS)
test-verbose: ## Run tests with verbose output
@echo "🧪 Running tests (verbose)"
uv run python -m pytest -vv -s $(ARGS)
test-cov: ## Run tests with coverage report
@echo "🧪 Running tests with coverage"
uv run python -m pytest --cov=sql_redis --cov-report=term-missing --cov-report=html $(ARGS)
check: lint test ## Run all checks (lint + test)
build: ## Build wheel and source distribution
@echo "🏗️ Building distribution packages"
uv build
docs-build: ## Build documentation
@echo "📚 Building documentation"
DISABLE_MKDOCS_2_WARNING=true uv run --group docs mkdocs build --strict
docs-serve: ## Serve documentation locally at http://localhost:8000
@echo "🌐 Serving documentation at http://localhost:8000"
DISABLE_MKDOCS_2_WARNING=true uv run --group docs mkdocs serve --dev-addr 127.0.0.1:8000
clean: ## Clean up build artifacts and caches
@echo "🧹 Cleaning up directory"
find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true
find . -type d -name ".pytest_cache" -exec rm -rf {} + 2>/dev/null || true
find . -type d -name ".mypy_cache" -exec rm -rf {} + 2>/dev/null || true
find . -type d -name ".coverage" -delete 2>/dev/null || true
find . -type d -name "htmlcov" -exec rm -rf {} + 2>/dev/null || true
find . -type d -name "dist" -exec rm -rf {} + 2>/dev/null || true
find . -type d -name "build" -exec rm -rf {} + 2>/dev/null || true
find . -type d -name "*.egg-info" -exec rm -rf {} + 2>/dev/null || true
find . -type f -name "*.log" -exec rm -rf {} + 2>/dev/null || true
rm -rf site
help: ## Show this help message
@echo "Available commands:"
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}'