forked from terrene-foundation/kailash-py
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
154 lines (129 loc) · 4.38 KB
/
Makefile
File metadata and controls
154 lines (129 loc) · 4.38 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
# Kailash Python SDK - Development Makefile
# This Makefile provides convenient commands for development tasks
.PHONY: help install install-dev test test-unit test-integration test-all
.PHONY: format lint type-check quality security pre-commit clean docs
.PHONY: build publish pre-release
# Default target
help:
@echo "Kailash Python SDK - Development Commands"
@echo ""
@echo "Setup Commands:"
@echo " install Install package in development mode"
@echo " install-dev Install with all development dependencies"
@echo " install-hooks Install pre-commit hooks"
@echo ""
@echo "Code Quality Commands:"
@echo " format Format code with Black and isort"
@echo " lint Run Ruff linter"
@echo " type-check Run mypy type checking"
@echo " quality Run all code quality checks"
@echo " security Run security scans (Trivy + detect-secrets)"
@echo " pre-commit Run all pre-commit hooks"
@echo ""
@echo "Testing Commands:"
@echo " test Run all tests"
@echo " test-unit Run unit tests only"
@echo " test-integration Run integration tests only"
@echo " test-fast Run fast tests (unit only)"
@echo ""
@echo "Documentation Commands:"
@echo " docs Build Sphinx documentation"
@echo " docs-serve Build and serve docs locally"
@echo ""
@echo "Release Commands:"
@echo " build Build distribution packages"
@echo " pre-release Run full pre-release checks"
@echo ""
@echo "Utility Commands:"
@echo " clean Clean build artifacts and cache"
@echo " update Update dependencies and pre-commit hooks"
@echo ""
@echo "Note: Workflow Studio has moved to a separate repo (enterprise-app)"
# Installation commands
install:
uv sync
install-dev:
uv sync
uv add --dev pre-commit detect-secrets doc8
install-hooks:
pre-commit install
pre-commit install --hook-type pre-push
@echo "Pre-commit hooks installed successfully"
# Code quality commands
format:
@echo "Formatting code with Black..."
black src/ tests/ docs/
@echo "Sorting imports with isort..."
isort src/ tests/ docs/
lint:
@echo "Running Ruff linter..."
ruff check src/ tests/ --fix
type-check:
@echo "Running mypy type checking..."
mypy src/ --ignore-missing-imports --no-strict-optional
quality: format lint type-check
@echo "All code quality checks completed"
security:
@echo "Running Trivy security scan..."
trivy filesystem --security-checks vuln,secret,config --severity HIGH,CRITICAL --quiet .
@echo "Running detect-secrets..."
detect-secrets scan --baseline .secrets.baseline .
pre-commit:
@echo "Running all pre-commit hooks..."
pre-commit run --all-files
# Testing commands
test:
@echo "Running all tests..."
pytest tests/ -v --tb=short
test-unit:
@echo "Running unit tests..."
pytest tests/ -v --tb=short -m "not integration"
test-integration:
@echo "Running integration tests..."
pytest tests/integration/ -v --tb=short
test-fast: test-unit
@echo "Fast tests completed"
# Documentation commands
docs:
@echo "Building Sphinx documentation..."
cd docs && python build_docs.py
docs-serve: docs
@echo "Serving documentation locally..."
cd docs/_build/html && python -m http.server 8000
# Release commands
build:
@echo "Building distribution packages..."
uv build
pre-release: clean quality security test docs
@echo "Pre-release checks completed successfully"
@echo "Ready for release!"
# Utility commands
clean:
@echo "Cleaning build artifacts..."
rm -rf build/
rm -rf dist/
rm -rf src/*.egg-info/
rm -rf .pytest_cache/
rm -rf .mypy_cache/
rm -rf .ruff_cache/
find . -type d -name __pycache__ -exec rm -rf {} +
find . -type f -name "*.pyc" -delete
find . -type f -name "*.pyo" -delete
@echo "Clean completed"
update:
@echo "Updating dependencies..."
uv sync --upgrade
@echo "Updating pre-commit hooks..."
pre-commit autoupdate
@echo "Update completed"
# Development workflow shortcuts
dev-setup: install-dev install-hooks
@echo "Development environment setup completed"
@echo "Run 'make pre-commit' to test your setup"
commit-ready: quality test-fast
@echo "Code is ready for commit!"
push-ready: quality test security
@echo "Code is ready for push!"
# CI simulation
ci: quality test security docs
@echo "CI checks completed successfully"