-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
110 lines (89 loc) · 2.87 KB
/
Makefile
File metadata and controls
110 lines (89 loc) · 2.87 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
101
102
103
104
105
106
107
108
109
110
.PHONY: help install install-dev dev test test-fast test-parallel lint format fmt type clean build docs
help:
@echo "PyGuard - Development Makefile"
@echo ""
@echo "Available targets:"
@echo " install - Install PyGuard in production mode"
@echo " install-dev - Install PyGuard with development dependencies"
@echo " dev - Alias for install-dev"
@echo " test - Run test suite with coverage"
@echo " test-fast - Run tests without coverage"
@echo " test-parallel - Run tests in parallel (32% faster)"
@echo " lint - Run all linters (ruff, pylint, mypy)"
@echo " format - Format code with black and isort"
@echo " fmt - Alias for format"
@echo " type - Run type checking with mypy"
@echo " clean - Remove build artifacts and cache files"
@echo " build - Build distribution packages"
@echo " docs - Generate documentation"
@echo " benchmark - Run performance benchmarks"
@echo " security - Run security checks with bandit"
install:
pip install -e .
install-dev:
pip install -e ".[dev]"
# Alias for install-dev
dev: install-dev
@echo "✅ Development dependencies installed!"
test:
pytest tests/ -v --cov=pyguard --cov-report=term-missing --cov-report=html
test-fast:
pytest tests/ --no-cov -x
test-parallel:
pytest tests/ -n auto --no-cov -q
lint:
@echo "Running ruff..."
ruff check pyguard/
@echo "Running pylint..."
pylint pyguard/
@echo "Running mypy..."
mypy pyguard/
@echo "Running flake8..."
flake8 pyguard/
format:
@echo "Formatting with black..."
black pyguard/ tests/ examples/
@echo "Sorting imports with isort..."
isort pyguard/ tests/ examples/
# Alias for format
fmt: format
# Type checking target
type:
@echo "Running type checks with mypy..."
mypy pyguard/
clean:
@echo "Cleaning build artifacts..."
rm -rf build/ dist/ *.egg-info
rm -rf .pytest_cache/ .coverage htmlcov/
rm -rf .mypy_cache/ .ruff_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
@echo "Clean complete!"
build: clean
python -m build
docs:
@echo "Building documentation..."
@echo "Documentation generation not yet implemented"
benchmark:
@echo "Running benchmarks..."
python benchmarks/bench_security.py
security:
@echo "Running security checks..."
bandit -r pyguard/ -ll
# Continuous Integration targets
ci-test:
pytest tests/ -v --cov=pyguard --cov-report=xml --cov-report=term
ci-lint:
ruff check pyguard/ --output-format=github
pylint pyguard/ --output-format=colorized
# Development helpers
dev-setup: install-dev
pre-commit install
@echo "Development environment ready!"
watch-test:
@echo "Watching for changes..."
pytest-watch tests/ -v
# Quick checks before commit
pre-commit: format lint test-fast
@echo "✅ Pre-commit checks passed!"