forked from paiml/databricks-governance
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
75 lines (62 loc) · 2.14 KB
/
Copy pathMakefile
File metadata and controls
75 lines (62 loc) · 2.14 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
# Makefile for databricks-governance
# Use 'uv' for all Python operations
.PHONY: all install test lint format coverage clean help
# Default Python/uv commands
PYTHON := uv run python
RUFF := uv run ruff
PYTEST := uv run pytest
# Default target
all: lint test
# Install dependencies
install:
@echo "=== Installing dependencies ==="
uv sync --all-extras
# Run all tests
test:
@echo "=== Running tests ==="
$(PYTEST) tests/ -v
# Run linting
lint:
@echo "=== Running linter ==="
$(RUFF) check examples/ --ignore E501,E722
# Format code
format:
@echo "=== Formatting code ==="
$(RUFF) format examples/
$(RUFF) check examples/ --fix --ignore E501,E722
# Run tests with coverage
coverage:
@echo "=== Running tests with coverage ==="
$(PYTEST) tests/ --cov=examples --cov-report=term-missing --cov-report=html
# Create demo groups in Databricks (run before access-control SQL examples)
setup-groups:
@echo "=== Creating demo groups in Databricks ==="
$(PYTHON) examples/setup/create_groups.py
# Remove demo groups from Databricks (run after finishing the examples)
teardown-groups:
@echo "=== Removing demo groups from Databricks ==="
$(PYTHON) examples/setup/teardown_groups.py
# Validate Python syntax in all examples
validate:
@echo "=== Validating Python syntax ==="
$(PYTHON) -m py_compile examples/**/*.py
# Clean build artifacts
clean:
@echo "=== Cleaning build artifacts ==="
rm -rf __pycache__ .pytest_cache .coverage htmlcov .mypy_cache .ruff_cache
rm -rf build dist *.egg-info
find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true
find . -type f -name "*.pyc" -delete 2>/dev/null || true
# Help
help:
@echo "Available targets:"
@echo " install - Install dependencies with uv"
@echo " test - Run all tests"
@echo " lint - Run linter"
@echo " format - Format code"
@echo " coverage - Run tests with coverage"
@echo " validate - Validate Python syntax"
@echo " setup-groups - Create demo groups in Databricks (run before SQL examples)"
@echo " teardown-groups - Remove demo groups from Databricks"
@echo " clean - Clean build artifacts"
@echo " help - Show this help"