-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathMakefile
More file actions
97 lines (79 loc) · 3.03 KB
/
Makefile
File metadata and controls
97 lines (79 loc) · 3.03 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
.PHONY: help test lint format check install clean
# Default target
help:
@echo "Available targets:"
@echo " install - Install dependencies with uv"
@echo " test - Run all tests (unit + integration)"
@echo " test-unit - Run unit tests only"
@echo " test-integration - Run integration tests only"
@echo " test-cov - Run all tests with coverage"
@echo " test-unit-cov - Run unit tests with coverage"
@echo " test-integration-cov - Run integration tests with coverage"
@echo " lint - Run all linting checks (includes mypy)"
@echo " lint-quick - Run linting checks (skip mypy type checking)"
@echo " format - Auto-fix formatting issues"
@echo " check - Run both linting and tests"
@echo " clean - Clean up cache and temp files"
# Development setup
install:
uv sync --dev
# Testing targets
test: test-unit test-integration
@echo "All tests completed!"
test-unit:
@echo "Running unit tests..."
uv run pytest tests/unit_tests/ -v
test-integration:
@echo "Running integration tests..."
uv run pytest tests/integration_tests/ -v
test-cov:
uv run pytest --cov=connectchain --cov-report=term-missing
test-unit-cov:
uv run pytest tests/unit_tests/ --cov=connectchain --cov-report=term-missing
test-integration-cov:
uv run pytest tests/integration_tests/ --cov=connectchain --cov-report=term-missing
test-verbose:
uv run pytest -v
# Linting targets
lint: lint-black lint-isort lint-pylint lint-mypy
@echo ""
@echo "All linting checks completed!"
lint-black:
@echo "Running Black formatting check..."
@uv run black --check --diff connectchain/ || (echo "Black formatting check failed. Run 'make format' to fix." && exit 1)
@echo "Black formatting check passed"
lint-isort:
@echo "Running isort import sorting check..."
@uv run isort --check-only --diff connectchain/ || (echo "Import sorting check failed. Run 'make format' to fix." && exit 1)
@echo "Import sorting check passed"
lint-pylint:
@echo "Running Pylint code analysis..."
@uv run pylint --fail-under=9.0 connectchain/ || (echo "Pylint analysis failed" && exit 1)
@echo "Pylint analysis passed"
lint-mypy:
@echo "Running MyPy type checking..."
@uv run mypy connectchain/ || (echo "MyPy type checking failed" && exit 1)
@echo "MyPy type checking passed"
# Auto-formatting
format:
@echo "Auto-formatting code..."
@echo " Running Black formatter..."
@uv run black connectchain/
@echo " Running isort import sorter..."
@uv run isort connectchain/
@echo "Code formatting completed!"
# Combined checks
check: lint test
# Less strict linting (skip mypy for now)
lint-quick: lint-black lint-isort lint-pylint
@echo ""
@echo "Quick linting checks completed! (MyPy skipped)"
# Cleanup
clean:
find . -type d -name "__pycache__" -exec rm -rf {} +
find . -type d -name "*.egg-info" -exec rm -rf {} +
find . -type d -name ".pytest_cache" -exec rm -rf {} +
find . -type d -name ".mypy_cache" -exec rm -rf {} +
rm -rf .coverage
rm -rf dist/
rm -rf build/