1+ .PHONY : help install test test-unit test-integration test-performance test-all lint format clean coverage docs
2+
3+ # Default target
4+ help :
5+ @echo " ByteWaves Testing Framework"
6+ @echo " =========================="
7+ @echo " "
8+ @echo " Available targets:"
9+ @echo " install - Install the package with development dependencies"
10+ @echo " test - Run all tests"
11+ @echo " test-unit - Run unit tests only"
12+ @echo " test-int - Run integration tests only"
13+ @echo " test-perf - Run performance tests only"
14+ @echo " test-all - Run all tests with coverage"
15+ @echo " lint - Run linting checks"
16+ @echo " format - Format code with black and isort"
17+ @echo " clean - Clean up generated files"
18+ @echo " coverage - Generate coverage report"
19+ @echo " docs - Generate documentation"
20+ @echo " ci - Run full CI pipeline locally"
21+
22+ # Installation
23+ install :
24+ @echo " Installing ByteWaves with development dependencies..."
25+ @if command -v uv & > /dev/null; then \
26+ uv sync --dev; \
27+ else \
28+ pip install -e " .[dev]" ; \
29+ fi
30+
31+ # Testing targets
32+ test :
33+ @echo " Running all tests..."
34+ @if command -v uv & > /dev/null; then \
35+ uv run pytest tests/ -v; \
36+ else \
37+ pytest tests/ -v; \
38+ fi
39+
40+ test-unit :
41+ @echo " Running unit tests..."
42+ @if command -v uv & > /dev/null; then \
43+ uv run pytest tests/unit/ -v; \
44+ else \
45+ pytest tests/unit/ -v; \
46+ fi
47+
48+ test-int :
49+ @echo " Running integration tests..."
50+ @if command -v uv & > /dev/null; then \
51+ uv run pytest tests/integration/ -v; \
52+ else \
53+ pytest tests/integration/ -v; \
54+ fi
55+
56+ test-perf :
57+ @echo " Running performance tests..."
58+ @if command -v uv & > /dev/null; then \
59+ uv run pytest tests/performance/ -v; \
60+ else \
61+ pytest tests/performance/ -v; \
62+ fi
63+
64+ test-all :
65+ @echo " Running all tests with coverage..."
66+ @if command -v uv & > /dev/null; then \
67+ uv run pytest tests/ --cov=bytewaves --cov-report=html --cov-report=term-missing; \
68+ else \
69+ pytest tests/ --cov=bytewaves --cov-report=html --cov-report=term-missing; \
70+ fi
71+
72+ # Code quality
73+ lint :
74+ @echo " Running linting checks..."
75+ @if command -v uv & > /dev/null; then \
76+ uv run flake8 bytewaves/; \
77+ uv run black --check --diff bytewaves/; \
78+ uv run isort --check-only --diff bytewaves/; \
79+ else \
80+ flake8 bytewaves/; \
81+ black --check --diff bytewaves/; \
82+ isort --check-only --diff bytewaves/; \
83+ fi
84+
85+ format :
86+ @echo " Formatting code..."
87+ @if command -v uv & > /dev/null; then \
88+ uv run black bytewaves/; \
89+ uv run isort bytewaves/; \
90+ else \
91+ black bytewaves/; \
92+ isort bytewaves/; \
93+ fi
94+
95+ # Cleanup
96+ clean :
97+ @echo " Cleaning up generated files..."
98+ @rm -rf build/
99+ @rm -rf dist/
100+ @rm -rf * .egg-info/
101+ @rm -rf .coverage
102+ @rm -rf coverage.xml
103+ @rm -rf htmlcov/
104+ @rm -rf .pytest_cache/
105+ @rm -rf __pycache__/
106+ @find . -type d -name __pycache__ -exec rm -rf {} + 2> /dev/null || true
107+ @find . -type f -name " *.pyc" -delete 2> /dev/null || true
108+
109+ # Coverage
110+ coverage :
111+ @echo " Generating coverage report..."
112+ @if command -v uv & > /dev/null; then \
113+ uv run pytest tests/ --cov=bytewaves --cov-report=html; \
114+ else \
115+ pytest tests/ --cov=bytewaves --cov-report=html; \
116+ fi
117+ @echo " Coverage report generated in htmlcov/index.html"
118+
119+ # Documentation
120+ docs :
121+ @echo " Generating documentation..."
122+ @if command -v uv & > /dev/null; then \
123+ uv run sphinx-build docs/ docs/_build/; \
124+ else \
125+ sphinx-build docs/ docs/_build/; \
126+ fi
127+
128+ # Local CI simulation
129+ ci : lint test-all coverage
130+ @echo " CI pipeline completed successfully!"
131+
132+ # Quick test (fast feedback)
133+ quick-test :
134+ @echo " Running quick test suite..."
135+ @if command -v uv & > /dev/null; then \
136+ uv run pytest tests/unit/ -x; \
137+ else \
138+ pytest tests/unit/ -x; \
139+ fi
140+
141+ # Benchmark specific components
142+ benchmark :
143+ @echo " Running benchmarks..."
144+ @if command -v uv & > /dev/null; then \
145+ uv run pytest tests/performance/test_benchmarks.py -v; \
146+ else \
147+ pytest tests/performance/test_benchmarks.py -v; \
148+ fi
149+
150+ # Security scan
151+ security :
152+ @echo " Running security checks..."
153+ @if command -v uv & > /dev/null; then \
154+ uv run safety check; \
155+ uv run bandit -r bytewaves/; \
156+ else \
157+ safety check; \
158+ bandit -r bytewaves/; \
159+ fi
160+
161+ # Development workflow
162+ dev-setup : install
163+ @echo " Setting up development environment..."
164+ @cp -n requirements-dev.txt requirements-dev.txt.backup 2> /dev/null || true
165+ @echo " Installing pre-commit hooks..."
166+ @if command -v uv & > /dev/null; then \
167+ uv run pre-commit install; \
168+ else \
169+ pre-commit install; \
170+ fi
171+
172+ # Quick check for common issues
173+ health-check :
174+ @echo " Running health checks..."
175+ @if command -v uv & > /dev/null; then \
176+ uv run python -c " import bytewaves; print('✅ Import successful')" ; \
177+ uv run python -m py_compile bytewaves/* .py; \
178+ else \
179+ python -c " import bytewaves; print('✅ Import successful')" ; \
180+ python -m py_compile bytewaves/* .py; \
181+ fi
182+ @echo " Health check completed"
0 commit comments