-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
201 lines (159 loc) Β· 6.86 KB
/
Makefile
File metadata and controls
201 lines (159 loc) Β· 6.86 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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
# ===================================================================
# deepctl Makefile - Development Tools
# ===================================================================
#
# Quick Start:
# make dev-setup # First time setup
# make dev # Daily development (format + lint + test)
# make help # Show organized help
#
# For new contributors: see README.md
# ===================================================================
.PHONY: help
.DEFAULT_GOAL := help
# ===================================================================
# HELP & INFO
# ===================================================================
help: ## Show this help message
@echo "π§ deepctl - Deepgram CLI Development Tools"
@echo ""
@echo "Usage: make [target]"
@echo ""
@echo "π \033[1mQuick Start:\033[0m"
@echo " \033[36mdev-setup\033[0m Set up development environment"
@echo " \033[36mdev\033[0m Format, lint, and test (full dev cycle)"
@echo " \033[36mtest\033[0m Run tests"
@echo ""
@echo "π§ͺ \033[1mTesting:\033[0m"
@echo " \033[36mtest\033[0m Run tests (development)"
@echo " \033[36mcheck\033[0m Quick quality check (no tests)"
@echo ""
@echo "π§ \033[1mCode Quality:\033[0m"
@echo " \033[36mformat\033[0m Auto-format code"
@echo " \033[36mlint\033[0m Run all linters"
@echo " \033[36mtypecheck\033[0m Run mypy type checker"
@echo ""
@echo "π§Ή \033[1mUtilities:\033[0m"
@echo " \033[36mclean\033[0m Clean build artifacts"
@echo " \033[36minfo\033[0m Show project information"
@echo " \033[36mhelp-all\033[0m Show all available targets"
@echo ""
@echo "For more targets, run: \033[36mmake help-all\033[0m"
help-all: ## Show all available targets
@echo "π§ deepctl - All Available Targets"
@echo ""
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | grep -v '^\.' | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-25s\033[0m %s\n", $$1, $$2}'
info: ## Show project information
@echo "π§ deepctl - Deepgram CLI"
@echo "π $(shell pwd)"
@echo "π Python: $(shell python --version 2>/dev/null || echo 'Not found')"
@echo "π¦ uv: $(shell uv --version 2>/dev/null || echo 'Not found')"
@echo "π― Virtual env: $(shell echo $$VIRTUAL_ENV || echo 'Not activated')"
# ===================================================================
# DEVELOPMENT SETUP
# ===================================================================
dev-setup: ## Set up complete development environment
uv venv
uv pip install -e ".[dev]"
@echo "β
Development environment ready!"
@echo "Activate with: source .venv/bin/activate (Linux/macOS) or .venv\\Scripts\\activate (Windows)"
install: ## Install runtime dependencies only
uv pip install -e .
install-dev: ## Install all development dependencies (includes testing)
uv pip install -e ".[dev]"
# ===================================================================
# QUICK DEVELOPMENT WORKFLOWS
# ===================================================================
dev: format lint-fix test ## Run full development cycle: format, fix lints, test
@echo "β
Development cycle complete!"
check: format-check lint-check typecheck ## Quick quality check (no tests)
@echo "β
Quick check complete!"
# ===================================================================
# TESTING
# ===================================================================
test: ## Run tests with pytest
uv run pytest
test-quick: ## Run tests quickly (no coverage)
uv run pytest -x
test-verbose: ## Run tests with verbose output
uv run pytest -xvs
test-watch: ## Run tests in watch mode (requires pytest-watch)
uv run ptw
# ===================================================================
# CODE QUALITY
# ===================================================================
## Formatting
format: ## Auto-format code with ruff
uv run ruff format src/ packages/**/src
format-check: ## Check code formatting (no changes)
uv run ruff format --check src/ packages/**/src
## Linting
lint: format-check lint-check typecheck ## Run all linters
@echo "β
All linters passed!"
lint-fix: ## Run ruff with auto-fix
uv run ruff check --fix src/ packages/**/src
lint-check: ## Run ruff without fixes
uv run ruff check src/ packages/**/src
## Type Checking
typecheck: ## Run mypy type checker
uv run mypy src/ packages/**/src
## All Checks
quality: format-check lint-check typecheck ## Run all quality checks
# ===================================================================
# RELEASE MANAGEMENT
# ===================================================================
build: clean ## Build all packages into dist/
@pip install build
@for pkg in . packages/*; do \
if [ -f "$$pkg/pyproject.toml" ]; then \
echo " Building $$pkg..."; \
python -m build "$$pkg" --outdir dist/; \
fi; \
done
verify-packages: ## Verify built packages with twine
@pip install twine
twine check dist/*
readmes: ## Generate sub-package READMEs from pyproject.toml metadata
python3 scripts/generate_readmes.py
readmes-check: ## Check sub-package READMEs are up to date
python3 scripts/generate_readmes.py --check
# ===================================================================
# RUNNING THE CLI
# ===================================================================
run: ## Run the CLI (show help)
uv run python -m deepctl --help
run-version: ## Show CLI version
uv run python -m deepctl --version
# ===================================================================
# CLEANUP
# ===================================================================
clean: ## Clean all build artifacts and caches
rm -rf build/
rm -rf dist/
rm -rf *.egg-info/
rm -rf packages/**/*.egg-info/
find . -type d -name __pycache__ -exec rm -rf {} +
find . -type f -name "*.pyc" -delete
rm -rf .pytest_cache/
rm -rf .coverage
rm -rf htmlcov/
rm -rf .mypy_cache/
rm -rf .ruff_cache/
clean-env: ## Remove virtual environment
rm -rf .venv/
# ===================================================================
# PRE-COMMIT HOOKS
# ===================================================================
pre-commit-install: ## Install pre-commit hooks
uv run pre-commit install
pre-commit-run: ## Run pre-commit on all files
uv run pre-commit run --all-files
# ===================================================================
# ALIASES (for convenience)
# ===================================================================
.PHONY: t tl q f l
t: test ## Alias for test
tl: lint ## Alias for lint
q: check ## Alias for check (quick)
f: format ## Alias for format
l: lint-fix ## Alias for lint-fix