-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
116 lines (89 loc) · 2.96 KB
/
Makefile
File metadata and controls
116 lines (89 loc) · 2.96 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
# ==========================================================
# depkeeper — Development Makefile
# ==========================================================
# Auto-detect Python & venv
PYTHON ?= python3
PIP ?= $(PYTHON) -m pip
VENV ?= venv
ACTIVATE = . $(VENV)/bin/activate
# Colors
GREEN := \033[0;32m
BLUE := \033[0;34m
RESET := \033[0m
# Default target
.DEFAULT_GOAL := help
# ==========================================================
# Help
# ==========================================================
.PHONY: help
help:
@echo ""
@echo "$(BLUE)depkeeper - Development Commands$(RESET)"
@echo ""
@echo "$(GREEN)Available targets:$(RESET)"
@echo " install Install package in production mode"
@echo " install-dev Install package with dev dependencies"
@echo " test Run tests with coverage"
@echo " typecheck Run mypy static type checks"
@echo " docs Build mkdocs documentation"
@echo " clean Remove cache and build artifacts"
@echo " all Run typecheck and test"
@echo ""
# ==========================================================
# Installation
# ==========================================================
.PHONY: install
install:
$(PIP) install -e .
@echo "$(GREEN)✓ Installed depkeeper (prod mode)$(RESET)"
.PHONY: install-dev
install-dev:
$(PIP) install -e ".[dev]"
pre-commit install
@echo "$(GREEN)✓ Installed depkeeper (dev mode)$(RESET)"
# ==========================================================
# Code Quality
# ==========================================================
.PHONY: typecheck
typecheck:
mypy depkeeper
@echo "$(GREEN)✓ Type checking passed$(RESET)"
# ==========================================================
# Testing
# ==========================================================
.PHONY: test
test:
pytest --cov=depkeeper \
--cov-report=term-missing \
--cov-report=html \
--cov-report=xml
@echo "$(GREEN)✓ Tests ran successfully$(RESET)"
# ==========================================================
# Documentation
# ==========================================================
.PHONY: docs
docs:
mkdocs build
@echo "$(GREEN)✓ Documentation built$(RESET)"
.PHONY: docs-serve
docs-serve:
mkdocs serve
@echo "$(GREEN)✓ Documentation server running$(RESET)"
# ==========================================================
# Cleanup
# ==========================================================
.PHONY: clean
clean:
rm -rf build/ dist/ *.egg-info
rm -rf .pytest_cache/ .mypy_cache/
rm -rf htmlcov/ .coverage coverage.xml
find . -type d -name "__pycache__" -exec rm -rf {} +
find . -type f -name "*.pyc" -delete
find . -type f -name "*.pyo" -delete
@echo "$(GREEN)✓ Clean completed$(RESET)"
# ==========================================================
# Run all quality checks
# ==========================================================
.PHONY: all
all: typecheck test
@echo "$(GREEN)✓ All checks passed successfully!$(RESET)"