-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathMakefile
More file actions
122 lines (99 loc) · 3.5 KB
/
Makefile
File metadata and controls
122 lines (99 loc) · 3.5 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
111
112
113
114
115
116
117
118
119
120
121
122
.PHONY: help install dev-install clean test lint format type-check security check pre-commit-install pre-commit-run build release
# Default target
help:
@echo "Available commands:"
@echo " make install - Install package for production use"
@echo " make dev-install - Install package with development dependencies"
@echo " make clean - Remove build artifacts and caches"
@echo " make test - Run test suite"
@echo " make test-cov - Run tests with coverage (HTML + terminal)"
@echo " make test-cov-xml - Run tests with coverage (HTML + terminal + XML)"
@echo " make test-comprehensive - Run comprehensive tests with full coverage"
@echo " make test-coverage-summary - Show coverage summary report"
@echo " make lint - Run linting (flake8)"
@echo " make format - Format code (black, isort)"
@echo " make type-check - Run type checking (mypy)"
@echo " make security - Run security checks (bandit)"
@echo " make check - Run all quality checks (lint, type-check, test)"
@echo " make pre-commit-install - Install pre-commit hooks"
@echo " make pre-commit-run - Run pre-commit on all files"
@echo " make build - Build distribution packages"
@echo " make release - Full release workflow (clean, test, build)"
# Installation
install:
pip install -e .
dev-install:
pip install -e ".[dev]"
$(MAKE) pre-commit-install
# Cleaning
clean:
rm -rf build/
rm -rf dist/
rm -rf *.egg-info
rm -rf .pytest_cache/
rm -rf .mypy_cache/
rm -rf .tox/
rm -rf htmlcov/
rm -rf .coverage
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 "*.orig" -delete
# Testing
test:
pytest tests/ -v
test-cov:
pytest tests/ -v --cov=code_assistant_manager --cov-report=html --cov-report=term
test-cov-xml:
pytest tests/ -v --cov=code_assistant_manager --cov-report=html --cov-report=term --cov-report=xml
test-comprehensive:
pytest tests/ -v --cov=code_assistant_manager --cov-report=html --cov-report=term --cov-report=xml --tb=short --maxfail=5
test-coverage-summary:
python -m coverage report --include="code_assistant_manager/*" --omit="tests/*" --sort=cover
# Code quality
lint:
@echo "Running flake8..."
flake8 code_assistant_manager/
format:
@echo "Running isort..."
isort code_assistant_manager/ tests/
@echo "Running black..."
black code_assistant_manager/ tests/
format-check:
@echo "Checking isort..."
isort --check-only code_assistant_manager/ tests/
@echo "Checking black..."
black --check code_assistant_manager/ tests/
type-check:
@echo "Running mypy..."
mypy code_assistant_manager/
security:
@echo "Running bandit..."
bandit -r code_assistant_manager/ -c pyproject.toml
docstring-check:
@echo "Checking docstring coverage..."
interrogate code_assistant_manager/ -c pyproject.toml
# Combined checks
check: format-check lint type-check test
@echo "All checks passed!"
# Pre-commit
pre-commit-install:
pre-commit install
@echo "Pre-commit hooks installed successfully!"
pre-commit-run:
pre-commit run --all-files
pre-commit-update:
pre-commit autoupdate
# Building
build: clean
python3 setup.py bdist_wheel
# Release workflow
release: clean check build
@echo "Release build completed successfully!"
@echo "Distribution files:"
@ls -lh dist/
# Docker commands (future)
docker-build:
@echo "Docker build not yet implemented"
docker-run:
@echo "Docker run not yet implemented"