-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
94 lines (77 loc) · 2.4 KB
/
Makefile
File metadata and controls
94 lines (77 loc) · 2.4 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
# Makefile for RevertIT
.PHONY: help install install-dev test lint format clean build docs
# Default target
help:
@echo "Available targets:"
@echo " install - Install package for production use"
@echo " install-dev - Install package with development dependencies"
@echo " test - Run test suite"
@echo " test-cov - Run test suite with coverage"
@echo " lint - Run code linting (flake8, mypy)"
@echo " format - Format code (black, isort)"
@echo " format-check - Check code formatting without changes"
@echo " clean - Clean build artifacts"
@echo " build - Build distribution packages"
@echo " docs - Build documentation"
@echo " system-install - Install system-wide (requires sudo)"
@echo " system-uninstall - Uninstall system-wide (requires sudo)"
# Installation targets
install:
pip3 install -e .
install-dev:
pip3 install -e .
pip3 install -r requirements-dev.txt
# Testing targets
test:
python3 -m pytest tests/ -v
test-cov:
python3 -m pytest tests/ -v --cov=revertit --cov-report=html --cov-report=term
# Code quality targets
lint:
flake8 src/revertit tests/
mypy src/revertit
format:
black src/revertit tests/
isort src/revertit tests/
format-check:
black --check src/revertit tests/
isort --check-only src/revertit tests/
# Build targets
clean:
rm -rf build/
rm -rf dist/
rm -rf src/*.egg-info/
rm -rf .pytest_cache/
rm -rf htmlcov/
find . -type d -name __pycache__ -exec rm -rf {} +
find . -type f -name "*.pyc" -delete
build: clean
python3 setup.py sdist bdist_wheel
# Documentation targets
docs:
@echo "Documentation target not yet implemented"
@echo "See README.md for current documentation"
# System installation targets (require sudo)
system-install:
@echo "Installing revertit system-wide..."
@if [ "$$(id -u)" != "0" ]; then \
echo "Error: This target must be run with sudo"; \
exit 1; \
fi
./scripts/install.sh
system-uninstall:
@echo "Uninstalling revertit system-wide..."
@if [ "$$(id -u)" != "0" ]; then \
echo "Error: This target must be run with sudo"; \
exit 1; \
fi
./scripts/uninstall.sh
# Development workflow targets
dev-setup: install-dev
@echo "Development environment setup complete"
@echo "Run 'make test' to verify installation"
dev-test: format-check lint test
@echo "All development checks passed"
# CI/CD targets
ci: format-check lint test-cov
@echo "CI pipeline completed successfully"