-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
74 lines (61 loc) · 1.92 KB
/
Copy pathMakefile
File metadata and controls
74 lines (61 loc) · 1.92 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
# Makefile for add_headings.py project
# Provides convenient commands for testing and development
.PHONY: help test test-unit test-integration test-coverage test-fast lint format install-dev clean all
# Default target
help:
@echo "Available commands:"
@echo " test - Run all tests"
@echo " test-unit - Run unit tests only"
@echo " test-integration - Run integration tests only"
@echo " test-coverage - Run tests with coverage report"
@echo " test-fast - Run fast tests only (exclude slow tests)"
@echo " lint - Run code quality checks"
@echo " format - Format code with black and isort"
@echo " install-dev - Install development dependencies"
@echo " clean - Clean up generated files"
@echo " all - Run all tests and quality checks"
# Install development dependencies
install-dev:
pip install -r requirements-dev.txt
# Run all tests
test:
python -m pytest
# Run unit tests only
test-unit:
python -m pytest -m unit
# Run integration tests only
test-integration:
python -m pytest -m integration
# Run tests with coverage
test-coverage:
python -m pytest --cov=add_headings --cov-report=html --cov-report=term
# Run fast tests only
test-fast:
python -m pytest -m "not slow"
# Run code quality checks
lint:
python -m flake8 add_headings.py tests/
python -m black --check add_headings.py tests/
python -m isort --check-only add_headings.py tests/
python -m mypy add_headings.py
# Format code
format:
python -m black add_headings.py tests/
python -m isort add_headings.py tests/
# Clean up generated files
clean:
rm -rf __pycache__/
rm -rf tests/__pycache__/
rm -rf .pytest_cache/
rm -rf htmlcov/
rm -rf .coverage
rm -rf .mypy_cache/
find . -name "*.pyc" -delete
find . -name "*.pyo" -delete
find . -name "*~" -delete
# Run everything
all: test-coverage lint
@echo "All checks completed!"
# Quick smoke test
smoke:
python -m pytest -m smoke -x