-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
71 lines (61 loc) · 2.19 KB
/
Copy pathMakefile
File metadata and controls
71 lines (61 loc) · 2.19 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
# Tools Repository Makefile
# Provides common development tasks for the Tools monorepo
#
# Usage:
# make help - Show available targets
# make lint - Run all linters
# make format - Format code
# make test - Run tests
# make clean - Clean build artifacts
.PHONY: help lint format test coverage clean install check all
# Default target
help:
@echo "Tools Repository - Available targets:"
@echo ""
@echo " make install - Install dependencies"
@echo " make lint - Run linters (ruff, mypy)"
@echo " make format - Format code (ruff format)"
@echo " make test - Run pytest"
@echo " make check - Run all checks (lint + test)"
@echo " make clean - Remove build artifacts"
@echo " make coverage - Run pytest with coverage and emit coverage.json"
@echo " make all - Install, format, lint, test"
@echo ""
# Install dependencies
install:
python -m pip install -r requirements.txt
python -m pip install -e ".[dev]"
# Run linters
lint:
@echo "Running ruff check..."
python -m ruff check .
@echo "Running mypy (errors are advisory; see CONTRIBUTING.md)..."
python -m mypy . --config-file mypy.ini || true
# Format code
# ruff format replaces black in this repo (see requirements.txt note);
# the legacy `python -m black .` invocation was removed as part of #2094.
format:
@echo "Running ruff format..."
python -m ruff format .
@echo "Running ruff fix..."
python -m ruff check . --fix || true
# Run tests
test:
@echo "Running pytest..."
python -m pytest
# Run tests with coverage and emit coverage.json
coverage:
@echo "Running pytest with coverage..."
python -m pytest --cov=src --cov-report=json:coverage.json --cov-report=term-missing -n auto
# Run all checks
check: lint test
@echo "All checks complete."
# Clean build artifacts
clean:
@echo "Cleaning build artifacts..."
find . -type d \( -name "__pycache__" -o -name ".pytest_cache" -o -name ".mypy_cache" -o -name ".ruff_cache" -o -name "*.egg-info" \) -exec rm -rf {} + 2>/dev/null || true
find . -type f \( -name "*.pyc" -o -name "*_output.txt" -o -name "*_temp.txt" \) -delete 2>/dev/null || true
@echo "Clean complete."
# Run everything
all: install format lint test
@echo "All tasks complete."