-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
100 lines (82 loc) · 2.65 KB
/
Makefile
File metadata and controls
100 lines (82 loc) · 2.65 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
98
99
100
# Makefile for TestIQ
.PHONY: help install test lint format clean build publish
help:
@echo "TestIQ - Development Commands"
@echo ""
@echo "install - Install package with dev dependencies"
@echo "test - Run tests with coverage"
@echo "test-fast - Run tests without coverage"
@echo "test-complete- Run complete analysis (coverage + duplicates)"
@echo "test-dup - Find duplicate tests only"
@echo "lint - Run ruff linter"
@echo "format - Format code with black and ruff"
@echo "format-check - Check code formatting"
@echo "clean - Remove build artifacts and cache files"
@echo "build - Build distribution packages"
@echo "publish-test - Publish to TestPyPI"
@echo "publish - Publish to PyPI"
@echo "demo - Run TestIQ demo"
@echo "dev - Install in development mode"
install:
uv pip install --system -e ".[dev]"
dev: install
test:
pytest tests/ -v --cov=testiq --cov-report=term --cov-report=html
test-fast:
pytest tests/ -v
test-complete:
@echo "Running complete analysis (coverage + duplicate detection)..."
./run_complete_analysis.sh tests/
test-dup:
@echo "Running duplicate test detection..."
pytest tests/ --testiq-output=testiq_coverage.json -q
testiq analyze testiq_coverage.json --format html --output reports/duplicates.html
testiq quality-score testiq_coverage.json
lint:
ruff check src/ tests/
format:
ruff check src/ tests/ --fix
python -m black src/ tests/
format-check:
ruff check src/ tests/
python -m black --check src/ tests/
clean:
@echo "Cleaning build artifacts..."
rm -rf build/
rm -rf dist/
rm -rf *.egg-info
rm -rf src/*.egg-info
@echo "Cleaning Python cache..."
find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
find . -type f -name "*.pyc" -delete
find . -type f -name "*.pyo" -delete
find . -type f -name "*.py,cover" -delete
@echo "Cleaning test and coverage artifacts..."
rm -rf .pytest_cache/
rm -rf .coverage
rm -rf htmlcov/
rm -rf .ruff_cache/
rm -rf .mypy_cache/
@echo "Cleaning temporary files..."
find . -type f -name "*~" -delete
find . -type f -name "*.bak" -delete
@echo "Clean complete!"
build: clean
@echo "Building package..."
uv build
publish-test: build
@echo "Publishing to TestPyPI..."
@echo "Make sure you have TESTPYPI_TOKEN set"
uv publish --token $(TESTPYPI_TOKEN) --publish-url https://test.pypi.org/legacy/
publish: build
@echo "Publishing to PyPI..."
@echo "Make sure you have PYPI_TOKEN set"
uv publish --token $(PYPI_TOKEN)
demo:
python -m testiq.cli demo
# Development helpers
watch-test:
pytest-watch tests/
coverage-report:
pytest tests/ --cov=testiq --cov-report=html
open htmlcov/index.html