-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
82 lines (68 loc) · 2.33 KB
/
Makefile
File metadata and controls
82 lines (68 loc) · 2.33 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
.PHONY: format lint check test clean install py
# Format code using ruff
format:
uvx ruff check --fix --select W293,W291,I001,F401,F541,W292,F541 --unsafe-fixes .
uvx ruff format .
# Run linting
lint:
uvx ruff check .
# uvx mypy graflow/
# Type check only
check:
uvx mypy .
# Run tests
test:
uv run pytest tests/ -v
# Run tests with coverage
test-cov:
uv run pytest tests/ --cov=flowlet --cov-report=html --cov-report=term
# Clean up cache and build artifacts
clean:
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 ".mypy_cache" -exec rm -rf {} + 2>/dev/null || true
find . -type d -name ".ruff_cache" -exec rm -rf {} + 2>/dev/null || true
rm -rf htmlcov/
rm -rf dist/
rm -rf build/
# Install dependencies
install:
uv sync
# Install development dependencies
install-dev:
uv sync --dev
# Install recommended extras (e.g., graphviz)
install-all:
export CFLAGS="-I$(brew --prefix graphviz)/include"
export LDFLAGS="-L$(brew --prefix graphviz)/lib"
uv sync --all-extras --dev
# Run all checks (format, lint, test)
check-all: format lint test
# Quick fix for common issues
fix:
uvx ruff check --fix --unsafe-fixes .
uvx ruff format .
# Run Python files with proper environment setup
# Usage: make py examples/simple_test.py
py:
PYTHONPATH=. uv run python $(filter-out $@,$(MAKECMDGOALS))
# Catch-all target to prevent make from complaining about unknown targets
%:
@:
# Help
help:
@echo "Available targets:"
@echo " format - Format code using ruff"
@echo " lint - Run linting with ruff and mypy"
@echo " check - Run type checking with mypy"
@echo " test - Run tests"
@echo " test-cov - Run tests with coverage"
@echo " clean - Clean up cache and build artifacts"
@echo " install - Install dependencies"
@echo " install-dev - Install development dependencies"
@echo " install-extras - Install extras (e.g., graphviz)"
@echo " check-all - Run format, lint, and test"
@echo " fix - Quick fix for common issues"
@echo " py <file> - Run Python file with proper environment (e.g., make py examples/simple_test.py)"
@echo " help - Show this help message"