-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathMakefile
More file actions
143 lines (117 loc) · 4.82 KB
/
Makefile
File metadata and controls
143 lines (117 loc) · 4.82 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
.PHONY: help format lint check test clean install dev-install install-cloud install-cloud-dev build build-cloud build-all clean-build deps-check-python deps-check-frontend deps-check
# Default target executed when no arguments are given to make.
default: help
install-dev:
uv pip install --system -e .[dev,mcp]
git config --unset-all core.hooksPath && pre-commit install
install:
uv pip install --system .
install-cloud:
uv pip install --system -e ./recce_cloud
install-cloud-dev:
uv pip install --system -e ./recce_cloud[dev]
help:
@echo "Available commands:"
@echo " make help - Show this help message"
@echo " make format - Format code with Black and isort"
@echo " make format-cloud - Format recce-cloud code"
@echo " make flake8 - Run flake8 linting"
@echo " make flake8-cloud - Run flake8 on recce-cloud"
@echo " make mypy - Run type checking with mypy"
@echo " make check - Run all code quality checks without modifying files"
@echo " make check-cloud - Run code quality checks on recce-cloud"
@echo " make install - Install recce package"
@echo " make install-dev - Install recce with dev requirements"
@echo " make install-cloud - Install recce-cloud package"
@echo " make install-cloud-dev - Install recce-cloud in dev mode"
@echo " make dev - Run the frontend in dev mode"
@echo " make build - Build recce package"
@echo " make build-cloud - Build recce-cloud package"
@echo " make build-all - Build both packages"
@echo " make clean-build - Clean build artifacts"
@echo " make deps-check-python - Check Python deps for updates (requires: dependabot, Docker)"
@echo " make deps-check-frontend - Check frontend deps for updates (requires: dependabot, Docker)"
@echo " make deps-check - Check all deps for updates"
format:
@echo "Formatting with Black..."
black ./recce ./tests
@echo "Sorting imports with isort..."
isort ./recce ./tests
format-cloud:
@echo "Formatting recce-cloud with Black..."
black ./recce_cloud
@echo "Sorting imports with isort..."
isort ./recce_cloud
flake8:
@echo "Linting with flake8..."
flake8 ./recce ./tests
flake8-cloud:
@echo "Linting recce-cloud with flake8..."
flake8 ./recce_cloud
# Run all code quality checks without modifying files
check:
@echo "Checking code formatting with Black..."
black --check ./recce ./tests
@echo "Checking import order with isort..."
isort --check ./recce ./tests
@echo "Checking code style with flake8..."
flake8 ./recce ./tests
check-cloud:
@echo "Checking recce-cloud code formatting with Black..."
black --check ./recce_cloud
@echo "Checking recce-cloud import order with isort..."
isort --check ./recce_cloud
@echo "Checking recce-cloud code style with flake8..."
flake8 ./recce_cloud
test: install-dev
@echo "Running tests..."
@python3 -m pytest tests
test-coverage: install-dev
@echo "Running tests with coverage..."
@python3 -m pytest --cov=recce --cov-report=html --cov-report=term tests
@echo "Coverage report generated in htmlcov/index.html"
test-tox:
@echo "Running tests with Tox based on DBT versions..."
@tox run-parallel
test-tox-python-versions:
@echo "Running tests with Tox for specific Python versions..."
@tox run-parallel -e 3.10,3.11,3.12,3.13
install-frontend-requires:
# Install pnpm if not installed
@command -v pnpm || npm install -g pnpm
@cd js && pnpm install
dev: install-frontend-requires
@cd js && pnpm dev
# Build targets (packaging - using uv)
clean-build:
@echo "Cleaning build artifacts..."
@rm -rf build/ dist/ *.egg-info recce_cloud.egg-info
@find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
@find . -type f -name '*.pyc' -delete
build-frontend:
@echo "Building frontend static files..."
@cd js && pnpm install --frozen-lockfile && pnpm build
build: clean-build build-frontend
@echo "Building recce package..."
uv build
build-cloud: clean-build
@echo "Building recce-cloud package..."
uv build --package recce-cloud
build-all: clean-build build-frontend
@echo "Building both packages..."
uv build
uv build --package recce-cloud
@echo "Build complete!"
@echo "Packages in dist/:"
@ls -lh dist/
# Dependency update checks using Dependabot CLI
# Prerequisites: brew install dependabot, Docker running
# Optional: LOCAL_GITHUB_ACCESS_TOKEN env var for private packages
deps-check-python:
@echo "Checking Python dependency updates (requires Docker)..."
dependabot update pip DataRecce/recce --local . -d / -o deps-python.yml
deps-check-frontend:
@echo "Checking frontend dependency updates (requires Docker)..."
dependabot update npm_and_yarn DataRecce/recce --local . -d /js -o deps-frontend.yml
deps-check: deps-check-python deps-check-frontend
@echo "Dependency check complete. Results in deps-python.yml and deps-frontend.yml"