-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
82 lines (67 loc) · 2.87 KB
/
Makefile
File metadata and controls
82 lines (67 loc) · 2.87 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
# FastWoe Development Makefile
.PHONY: help install test test-all lint format typecheck typecheck-strict clean check-all
help: ## Show this help message
@echo "FastWoe Development Commands:"
@echo ""
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}'
install: ## Install development dependencies
uv sync --dev
test: ## Run tests (current Python)
uv run pytest
test-all: ## Run tests across all supported Python versions (3.9 → 3.14)
@for ver in 3.9 3.10 3.11 3.12 3.13 3.14; do \
echo "\n▶ Python $$ver"; \
uv run --python $$ver pytest tests/ -q -m "not compatibility" || exit 1; \
done
@echo "\n✅ All versions passed"
lint: ## Run linting
uv run ruff check fastwoe
format: ## Format code
uv run ruff format fastwoe
format-check: ## Check code formatting
uv run ruff format --check fastwoe
typecheck: ## Run type checking (lenient mode)
@echo "Running ty type checking..."
@uv run ty check fastwoe/fastwoe.py fastwoe/interpret_fastwoe.py || { \
echo "⚠️ Type checking completed with some remaining errors."; \
echo " Remaining errors are expected for pandas/numpy/faiss usage."; \
echo "✅ Development mode: Treating expected type errors as success"; \
exit 0; \
}
@echo "✅ Type checking passed"
mypy: ## Run mypy type checking
@echo "Running mypy type checking..."
@uv run mypy fastwoe/ --check-untyped-defs
@echo "✅ Mypy type checking passed"
typecheck-strict: ## Run type checking (strict mode)
@echo "Running ty type checking (strict mode)..."
@echo "🔒 Strict mode enabled"
@uv run ty check fastwoe/fastwoe.py fastwoe/interpret_fastwoe.py || { \
echo "⚠️ Strict type checking found issues (expected for pandas/numpy code)"; \
exit 1; \
}
clean: ## Clean build artifacts and virtual environments
rm -rf build/
rm -rf dist/
rm -rf *.egg-info/
rm -rf .venv/
rm -rf .venv.*/
find . -type d -name __pycache__ -exec rm -rf {} +
find . -type f -name "*.pyc" -delete
find . -type d -name ".pytest_cache" -exec rm -rf {} +
find . -type d -name ".ruff_cache" -exec rm -rf {} +
check-all: format-check lint typecheck mypy ## Run all checks (format, lint, typecheck, mypy)
# CI-friendly target
ci-check: format-check lint ## Run CI checks (without strict type checking)
@echo "🔍 Running type checking in CI mode..."
@echo "This mode ignores expected pandas/numpy/faiss type complexity"
@uv run ty check fastwoe/fastwoe.py fastwoe/interpret_fastwoe.py || { \
echo "⚠️ Type checking completed with some remaining errors."; \
echo " Remaining errors are expected for pandas/numpy/faiss usage."; \
echo "🔧 CI mode: Treating expected type errors as success"; \
exit 0; \
}
@echo "✅ CI type checking passed"
@echo "🔍 Running mypy type checking..."
@uv run mypy fastwoe/ --check-untyped-defs
@echo "✅ Mypy type checking passed"