-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
145 lines (104 loc) · 3.7 KB
/
Copy pathMakefile
File metadata and controls
145 lines (104 loc) · 3.7 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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# ---
# entity_id: jadecli-makefile
# entity_name: JadeCLI Makefile
# entity_type_id: config
# entity_path: Makefile
# entity_language: make
# entity_state: active
# entity_created: 2026-01-22T22:00:00Z
# entity_actors: [dev, claude]
# ---
# JadeCLI Makefile - Modern Python development with uv
# Usage: make <target>
.PHONY: help build install install-dev clean test lint format typecheck all
# Default target
.DEFAULT_GOAL := help
# Colors for output
CYAN := \033[36m
GREEN := \033[32m
YELLOW := \033[33m
RESET := \033[0m
# Python and uv settings
PYTHON := python3.12
UV := uv
##@ General
help: ## Display this help
@awk 'BEGIN {FS = ":.*##"; printf "\n$(CYAN)Usage:$(RESET)\n make $(GREEN)<target>$(RESET)\n"} /^[a-zA-Z_-]+:.*?##/ { printf " $(GREEN)%-15s$(RESET) %s\n", $$1, $$2 } /^##@/ { printf "\n$(CYAN)%s$(RESET)\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
##@ Setup
install: ## Install production dependencies
$(UV) sync --no-dev
@echo "$(GREEN)✓ Production dependencies installed$(RESET)"
install-dev: ## Install development dependencies
$(UV) sync
$(UV) pip install -e ".[dev]"
@echo "$(GREEN)✓ Development dependencies installed$(RESET)"
setup: install-dev ## Full development setup
$(UV) run pre-commit install
@echo "$(GREEN)✓ Pre-commit hooks installed$(RESET)"
##@ Build
build: ## Build the package
$(UV) build
@echo "$(GREEN)✓ Package built$(RESET)"
build-wheel: ## Build wheel only
$(UV) build --wheel
@echo "$(GREEN)✓ Wheel built$(RESET)"
##@ Quality
lint: ## Run linter (ruff check)
$(UV) run ruff check .
lint-fix: ## Run linter with auto-fix
$(UV) run ruff check --fix .
@echo "$(GREEN)✓ Lint issues fixed$(RESET)"
format: ## Format code (ruff format)
$(UV) run ruff format .
@echo "$(GREEN)✓ Code formatted$(RESET)"
format-check: ## Check code formatting
$(UV) run ruff format --check .
typecheck: ## Run type checker (mypy)
$(UV) run mypy jadecli/
check: lint format-check typecheck ## Run all checks (lint, format, typecheck)
@echo "$(GREEN)✓ All checks passed$(RESET)"
fix: lint-fix format ## Fix all auto-fixable issues
@echo "$(GREEN)✓ All fixes applied$(RESET)"
##@ Testing
test: ## Run tests
$(UV) run pytest
test-cov: ## Run tests with coverage
$(UV) run pytest --cov=jadecli --cov-report=term-missing
test-fast: ## Run tests (fast, no coverage)
$(UV) run pytest -x -q
test-watch: ## Run tests in watch mode
$(UV) run pytest-watch
##@ Diagnostics
diagnostics: ## Run jadecli diagnostics
$(UV) run python -m jadecli.build.diagnostics
review-local: ## Run local PR review chain
$(UV) run python -m jadecli.workflows.coderabbit_chain review-local
##@ Cleanup
clean: ## Clean build artifacts
rm -rf build/ dist/ *.egg-info/
rm -rf .pytest_cache/ .mypy_cache/ .ruff_cache/
rm -rf htmlcov/ .coverage
find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true
@echo "$(GREEN)✓ Cleaned$(RESET)"
clean-all: clean ## Clean everything including venv
rm -rf .venv/
@echo "$(GREEN)✓ All cleaned$(RESET)"
##@ Release
version: ## Show current version
@$(UV) run python -c "import jadecli; print(jadecli.__version__)" 2>/dev/null || echo "0.1.0"
bump-patch: ## Bump patch version
@echo "$(YELLOW)TODO: Implement version bumping$(RESET)"
bump-minor: ## Bump minor version
@echo "$(YELLOW)TODO: Implement version bumping$(RESET)"
bump-major: ## Bump major version
@echo "$(YELLOW)TODO: Implement version bumping$(RESET)"
##@ Composite Targets
all: install-dev check test ## Full CI pipeline
@echo "$(GREEN)✓ All checks and tests passed$(RESET)"
ci: ## CI pipeline (for GitHub Actions)
$(UV) sync
$(UV) run ruff check .
$(UV) run ruff format --check .
$(UV) run mypy jadecli/
$(UV) run pytest --cov=jadecli
@echo "$(GREEN)✓ CI pipeline passed$(RESET)"