-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
169 lines (148 loc) · 5.23 KB
/
Makefile
File metadata and controls
169 lines (148 loc) · 5.23 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
# Quick reference for common development tasks. Run 'make help' for details.
# Default target: show help
.DEFAULT_GOAL := help
# Setup Commands
.PHONY: install
install:
uv sync --frozen --group dev
uv run --group dev pre-commit install --install-hooks
.PHONY: install-all
install-all:
uv sync --frozen --all-groups
uv run --group dev pre-commit install --install-hooks
.PHONY: sync
sync:
uv sync --group dev
# Development Commands
.PHONY: lint
lint:
uvx ruff check src/ tests/ ci/
.PHONY: format
format:
uvx ruff format src/ tests/ ci/
.PHONY: pre-commit
pre-commit:
uv run --group dev pre-commit run --all-files
# Testing Commands
.PHONY: test
test:
uv run --all-groups pytest
.PHONY: test-cov
test-cov:
uv run --all-groups pytest --cov=src --cov-branch --cov-report=html
# Dependency Testing Commands
.PHONY: test-dependency
test-dependency: # Test compatibility across different versions of a specific optional dependency.
@if [ -z "$(DEP)" ] || [ -z "$(VER)" ]; then \
echo "Error: DEP and VER must be specified"; \
echo "Usage: make test-dependency DEP=pyspark VER=3.5.3"; \
exit 1; \
fi
@docker build -t yads-test:latest -f ci/dependency-tests/docker/Dockerfile .
@docker run --rm yads-test:latest $(DEP) $(VER)
.PHONY: test-dependency-all
test-dependency-all: # Test compatibility across all versions of a specific optional dependency.
@if [ -z "$(DEP)" ]; then \
echo "Error: DEP must be specified"; \
echo "Usage: make test-dependency-all DEP=pyspark"; \
exit 1; \
fi
@docker build -t yads-test:latest -f ci/dependency-tests/docker/Dockerfile .
@echo "Testing all $(DEP) versions..."
@jq -r '.$(DEP)[]' ci/dependency-tests/versions.json | while read -r ver; do \
echo ""; \
docker run --rm yads-test:latest $(DEP) "$$ver" || exit 1; \
done
# Integration Testing Commands
.PHONY: test-integration
test-integration: # Run integration tests for a specific SQL dialect.
@if [ -z "$(DIALECT)" ]; then \
echo "Error: DIALECT must be specified"; \
echo "Usage: make test-integration DIALECT=spark"; \
echo "Available dialects: spark, duckdb, postgres"; \
echo "Use 'make test-integration-all' to test all dialects"; \
exit 1; \
fi
cd ci/integration-tests && ./scripts/run-integration.sh $(DIALECT)
.PHONY: test-integration-all
test-integration-all: # Run integration tests for all SQL dialects.
cd ci/integration-tests && ./scripts/run-integration.sh
# Build Commands
.PHONY: build
build:
uv build
@ls -lh dist/
# Cleanup Commands
.PHONY: clean
clean: # Clean test artifacts and caches.
rm -rf .coverage htmlcov .pytest_cache
find . -type d -name "__pycache__" -exec rm -rf {} +
find . -name "*.py[co]" -delete
.PHONY: clean-all
clean-all: # Clean all build artifacts and caches.
$(MAKE) clean
rm -rf .mypy_cache .ruff_cache dist
# Documentation Commands
.PHONY: docs-build
docs-build:
uv run --group docs zensical build
.PHONY: docs-serve
docs-serve:
uv run --group docs zensical serve
.PHONY: sync-examples
sync-examples:
@if [ -z "$(FILE)" ]; then \
echo "Error: FILE must be specified"; \
echo "Usage: make sync-examples FILE=docs/converters/pyarrow.md"; \
exit 1; \
fi
uv run --all-groups python -m docs.src.scripts.sync_examples "$(FILE)"
.PHONY: sync-examples-all
sync-examples-all:
uv run --all-groups python -m docs.src.scripts.sync_examples --all
# Help
.PHONY: help
help:
@echo "yads Makefile Commands"
@echo "======================"
@echo ""
@echo "Setup Commands:"
@echo " make install Install core and development dependencies and setup pre-commit hooks"
@echo " make install-all Install all dependencies and setup hooks"
@echo " make sync Update dependencies to match lockfile"
@echo ""
@echo "Development Commands:"
@echo " make lint Check code formatting and linting"
@echo " make format Auto-format code"
@echo " make pre-commit Run all pre-commit hooks"
@echo ""
@echo "Testing Commands:"
@echo " make test Run test suite"
@echo " make test-cov Run tests with coverage report"
@echo ""
@echo "Dependency Testing Commands:"
@echo " make test-dependency DEP=<name> VER=<version>"
@echo " Test specific dependency version (e.g., DEP=pyspark VER=3.5.3)"
@echo " make test-dependency-all DEP=<name>"
@echo " Test all versions of a dependency"
@echo ""
@echo "Integration Testing Commands:"
@echo " make test-integration DIALECT=<name>"
@echo " Run integration tests for specific dialect (spark, duckdb)"
@echo " make test-integration-all"
@echo " Run integration tests for all dialects"
@echo ""
@echo "Build Commands:"
@echo " make build Build package distributions"
@echo ""
@echo "Cleanup Commands:"
@echo " make clean Remove test artifacts and caches"
@echo " make clean-all Remove all build artifacts and caches"
@echo ""
@echo "Documentation Commands:"
@echo " make docs-build Build the documentation"
@echo " make docs-serve Serve the documentation"
@echo " make sync-examples FILE=<markdown>"
@echo " Sync code blocks for a single docs file"
@echo " make sync-examples-all"
@echo " Sync code blocks across all docs"