forked from OpenLineage/OpenLineage
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
135 lines (109 loc) · 5.01 KB
/
Makefile
File metadata and controls
135 lines (109 loc) · 5.01 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
# OpenLineage Development Makefile
#
# This project uses path-based dependencies instead of a UV workspace
# Each integration is now a standalone project with isolated dependencies
.PHONY: help setup-* test-* lint-* clean
# Colors for output
BLUE := \033[34m
GREEN := \033[32m
YELLOW := \033[33m
RED := \033[31m
NC := \033[0m # No Color
help: ## Show this help message
@echo "$(BLUE)OpenLineage Development Commands$(NC)"
@echo ""
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "$(GREEN)%-25s$(NC) %s\n", $$1, $$2}'
# =============================================================================
# Setup Commands - Install dependencies for specific integrations
# =============================================================================
setup-client: ## Setup Python client
@echo "$(BLUE)Setting up Python client...$(NC)"
cd client/python && uv sync --extra test --extra dev --extra generator --extra kafka --extra msk-iam --extra datazone --extra fsspec --active
setup-common: ## Setup integration common library
@echo "$(BLUE)Setting up integration common...$(NC)"
cd integration/common && uv sync --extra dev --active
setup-dbt: ## Setup dbt integration
@echo "$(BLUE)Setting up dbt integration...$(NC)"
cd integration/dbt && uv sync --extra dev --active
# =============================================================================
# Testing Commands
# =============================================================================
test-all: ## Run all tests
@echo "$(BLUE)Running all tests...$(NC)"
@$(MAKE) test-client
@$(MAKE) test-common
@$(MAKE) test-dbt
@echo "$(GREEN)✅ All tests completed!$(NC)"
test-client: ## Test Python client
@echo "$(BLUE)Testing Python client...$(NC)"
@$(MAKE) setup-client
cd client/python && uv run pytest tests/
test-common: ## Test integration common library
@echo "$(BLUE)Testing integration common...$(NC)"
@$(MAKE) setup-common
cd integration/common && uv run pytest tests/
test-dbt: ## Test dbt integration
@echo "$(BLUE)Testing dbt integration...$(NC)"
@$(MAKE) setup-dbt
cd integration/dbt && uv run pytest tests/
# =============================================================================
# Linting & Formatting
# =============================================================================
lint-all: ## Run all linting and type checking
@echo "$(BLUE)Running linting and type checking...$(NC)"
@$(MAKE) lint-format
@$(MAKE) lint-types
@echo "$(GREEN)✅ All linting completed!$(NC)"
lint-format: ## Run ruff formatting and linting
@echo "$(BLUE)Running ruff checks...$(NC)"
uv tool run ruff check .
uv tool run ruff format --check .
lint-types: ## Run mypy type checking per integration
@echo "$(BLUE)Running mypy type checking...$(NC)"
cd client/python && uv run mypy src/
cd integration/common && uv run mypy src/
cd integration/dbt && uv run mypy src/ --ignore-missing-imports
fix-format: ## Auto-fix formatting issues
@echo "$(BLUE)Auto-fixing format issues...$(NC)"
uv tool run ruff format .
uv tool run ruff check --fix .
# =============================================================================
# Development Shortcuts
# =============================================================================
dbt: ## Enter dbt integration directory
@echo "$(GREEN)🔧 Switching to dbt integration$(NC)"
@echo "Run: cd integration/dbt && uv sync --extra tests"
@cd integration/dbt && bash
client: ## Enter Python client directory
@echo "$(GREEN)🐍 Switching to Python client$(NC)"
@echo "Run: cd client/python && uv sync --extra tests"
@cd client/python && bash
# =============================================================================
# Status & Information
# =============================================================================
status: ## Show status of all integrations
@echo "$(BLUE)Integration Status:$(NC)"
@echo -n "Client Python: "; \
if [ -d "client/python/.venv" ]; then echo "$(GREEN)✅ Ready$(NC)"; else echo "$(RED)❌ Not setup$(NC)"; fi
@echo -n "Common: "; \
if [ -d "integration/common/.venv" ]; then echo "$(GREEN)✅ Ready$(NC)"; else echo "$(RED)❌ Not setup$(NC)"; fi
@echo -n "dbt: "; \
if [ -d "integration/dbt/.venv" ]; then echo "$(GREEN)✅ Ready$(NC)"; else echo "$(RED)❌ Not setup$(NC)"; fi
# =============================================================================
# Utility Commands
# =============================================================================
clean: ## Clean all virtual environments and caches
@echo "$(YELLOW)Cleaning virtual environments and caches...$(NC)"
rm -rf client/python/.venv
rm -rf integration/common/.venv
rm -rf integration/dbt/.venv
uv cache clean
@echo "$(GREEN)✅ Cleanup completed!$(NC)"
# =============================================================================
# CI Simulation
# =============================================================================
ci-test: ## Run the same checks that CI runs
@echo "$(BLUE)Running CI simulation...$(NC)"
@$(MAKE) lint-all
@$(MAKE) test-all
@echo "$(GREEN)✅ All CI checks passed!$(NC)"