.PHONY: build test test-rust test-python sparkless-parity pyspark-parity extract-pyspark-tests extract-pyspark-tests-expanded batch-regenerate-extracted test-parity-phase-a test-parity-phase-b test-parity-phase-c test-parity-phase-d test-parity-phase-e test-parity-phase-f test-parity-phase-g test-parity-phases bench-python clean check check-full fmt clippy audit outdated deny lint-python all gap-analysis gap-analysis-quick gap-analysis-runtime
export RUSTUP_TOOLCHAIN ?= stable
export CARGO_HOME := $(HOME)/.cargo
build:
cargo build
build-release:
cargo build --release
test-rust:
cargo test
lint-python:
@if [ ! -d .venv ]; then python3 -m venv .venv; fi
. .venv/bin/activate && pip install -q ruff 'mypy>=1.4,<1.10' && ruff format --check . && ruff check . && mypy .
test-python:
@if [ ! -d .venv ]; then python3 -m venv .venv; fi
. .venv/bin/activate && pip install -q maturin pytest && maturin develop --features "pyo3,sql,delta"
. .venv/bin/activate && pytest tests/python/ -v
test: test-rust test-python
bench-python:
@if [ ! -d .venv-sparkless ]; then python3 -m venv .venv-sparkless; fi
. .venv-sparkless/bin/activate && pip install -q maturin sparkless && maturin develop --features pyo3
. .venv-sparkless/bin/activate && python scripts/bench_robin_vs_sparkless.py
sparkless-parity:
@if [ -n "$$SPARKLESS_EXPECTED_OUTPUTS" ]; then \
mkdir -p tests/fixtures/converted; \
python3 tests/convert_sparkless_fixtures.py --batch "$$SPARKLESS_EXPECTED_OUTPUTS" tests/fixtures --output-subdir converted --dedupe; \
python3 tests/regenerate_expected_from_pyspark.py tests/fixtures/converted --include-skipped 2>/dev/null || true; \
fi
cargo test pyspark_parity_fixtures
pyspark-parity:
cargo test pyspark_parity_fixtures
extract-pyspark-tests:
@if [ -n "$$SPARK_REPO_PATH" ]; then \
python3 scripts/extract_pyspark_tests.py --spark-repo "$$SPARK_REPO_PATH"; \
else \
python3 scripts/extract_pyspark_tests.py --clone --branch v3.5.0; \
fi
@echo "Extracted fixtures -> tests/fixtures/pyspark_extracted. Run: make batch-regenerate-extracted"
extract-pyspark-tests-expanded: extract-pyspark-tests
batch-regenerate-extracted:
python3 scripts/batch_regenerate_extracted.py
test-parity-phase-a: ; PARITY_PHASE=a cargo test pyspark_parity_fixtures --
test-parity-phase-b: ; PARITY_PHASE=b cargo test pyspark_parity_fixtures --
test-parity-phase-c: ; PARITY_PHASE=c cargo test pyspark_parity_fixtures --
test-parity-phase-d: ; PARITY_PHASE=d cargo test pyspark_parity_fixtures --
test-parity-phase-e: ; PARITY_PHASE=e cargo test pyspark_parity_fixtures --
test-parity-phase-f: ; PARITY_PHASE=f cargo test pyspark_parity_fixtures --
test-parity-phase-g: ; PARITY_PHASE=g cargo test pyspark_parity_fixtures --
test-parity-phases: test-parity-phase-a test-parity-phase-b test-parity-phase-c test-parity-phase-d test-parity-phase-e test-parity-phase-f test-parity-phase-g
check: fmt clippy audit deny test-rust
@echo "All checks passed"
check-full: check lint-python test-python
@echo "All checks including Python passed"
fmt:
cargo fmt
@echo "Formatted"
fmt-check:
cargo fmt --check
clippy:
cargo clippy -- -D warnings
audit:
cargo audit
outdated:
cargo outdated
deny:
cargo deny check advisories bans sources
all: check
@echo "All updates and checks complete"
gap-analysis:
python3 scripts/extract_pyspark_api_from_repo.py --clone --branch v3.5.0 --output docs/pyspark_api_from_repo.json
python3 scripts/extract_robin_api_from_source.py --output docs/robin_api_from_source.json
python3 scripts/gap_analysis_pyspark_repo.py --pyspark docs/pyspark_api_from_repo.json --robin docs/robin_api_from_source.json --write-md docs/GAP_ANALYSIS_PYSPARK_REPO.md
@echo "Gap analysis complete. See docs/GAP_ANALYSIS_PYSPARK_REPO.md"
gap-analysis-quick:
@test -f docs/pyspark_api_from_repo.json || (echo "Run 'make gap-analysis' first to create docs/pyspark_api_from_repo.json" && exit 1)
python3 scripts/extract_robin_api_from_source.py --output docs/robin_api_from_source.json
python3 scripts/gap_analysis_pyspark_repo.py --pyspark docs/pyspark_api_from_repo.json --robin docs/robin_api_from_source.json --write-md docs/GAP_ANALYSIS_PYSPARK_REPO.md
@echo "Gap analysis complete. See docs/GAP_ANALYSIS_PYSPARK_REPO.md"
gap-analysis-runtime:
@test -f docs/pyspark_api_from_repo.json || (echo "Run 'make gap-analysis' first to create docs/pyspark_api_from_repo.json" && exit 1)
. .venv/bin/activate && pip install -q maturin && maturin develop --features "pyo3,sql,delta"
. .venv/bin/activate && python scripts/export_robin_signatures.py --output docs/signatures_robin_sparkless.json
python3 scripts/gap_analysis_pyspark_repo.py --pyspark docs/pyspark_api_from_repo.json --robin docs/signatures_robin_sparkless.json --write-md docs/GAP_ANALYSIS_PYSPARK_REPO.md
@echo "Gap analysis (runtime) complete. See docs/GAP_ANALYSIS_PYSPARK_REPO.md"
clean:
cargo clean
rm -rf target/