|
| 1 | +set quiet |
| 2 | +set dotenv-load := false |
| 3 | + |
| 4 | +# ─── Default ────────────────────────────────────────────────────────────────── |
| 5 | + |
| 6 | +# List all available recipes |
| 7 | +default: |
| 8 | + @just --list --unsorted |
| 9 | + |
| 10 | +# ─── Environment Setup ──────────────────────────────────────────────────────── |
| 11 | + |
| 12 | +# Install all dependencies (dev tools + optional deps) |
| 13 | +install: |
| 14 | + uv sync --all-extras --all-groups |
| 15 | + |
| 16 | +# Install core dependencies only (no optional deps) |
| 17 | +install-core: |
| 18 | + uv sync --group dev |
| 19 | + |
| 20 | +# Install documentation dependencies only |
| 21 | +install-docs: |
| 22 | + uv sync --group docs |
| 23 | + |
| 24 | +# ─── Code Quality ───────────────────────────────────────────────────────────── |
| 25 | + |
| 26 | +# Format code with ruff |
| 27 | +format: |
| 28 | + uv run ruff format . |
| 29 | + |
| 30 | +# Check formatting without modifying files |
| 31 | +format-check: |
| 32 | + uv run ruff format --check . |
| 33 | + |
| 34 | +# Lint code with ruff |
| 35 | +lint: |
| 36 | + uv run ruff check . |
| 37 | + |
| 38 | +# Lint and auto-fix issues |
| 39 | +lint-fix: |
| 40 | + uv run ruff check . --fix |
| 41 | + |
| 42 | +# Run ty type checker on maseval and tests |
| 43 | +typecheck: |
| 44 | + uv run ty check maseval tests |
| 45 | + |
| 46 | +# Run all quality checks (format, lint, typecheck) |
| 47 | +check: format-check lint typecheck |
| 48 | + |
| 49 | +# Format and fix lint issues |
| 50 | +fix: format lint-fix |
| 51 | + |
| 52 | +# ─── Testing — Core ────────────────────────────────────────────────────────── |
| 53 | + |
| 54 | +# Run default test suite (excludes slow, credentialed, smoke) |
| 55 | +test *ARGS: |
| 56 | + uv run pytest -v {{ ARGS }} |
| 57 | + |
| 58 | +# Run core tests only (no optional deps needed) |
| 59 | +test-core *ARGS: |
| 60 | + uv run pytest -m core -v {{ ARGS }} |
| 61 | + |
| 62 | +# Run interface tests (requires optional deps) |
| 63 | +test-interface *ARGS: |
| 64 | + uv run pytest -m interface -v {{ ARGS }} |
| 65 | + |
| 66 | +# Run cross-implementation contract tests |
| 67 | +test-contract *ARGS: |
| 68 | + uv run pytest -m contract -v {{ ARGS }} |
| 69 | + |
| 70 | +# Run fast benchmark tests (excludes slow/live) |
| 71 | +test-benchmark *ARGS: |
| 72 | + uv run pytest -m "benchmark and not (slow or live)" -v {{ ARGS }} |
| 73 | + |
| 74 | +# ─── Testing — Frameworks ──────────────────────────────────────────────────── |
| 75 | + |
| 76 | +# Run smolagents framework tests |
| 77 | +test-smolagents *ARGS: |
| 78 | + uv run pytest -m smolagents -v {{ ARGS }} |
| 79 | + |
| 80 | +# Run langgraph framework tests |
| 81 | +test-langgraph *ARGS: |
| 82 | + uv run pytest -m langgraph -v {{ ARGS }} |
| 83 | + |
| 84 | +# Run llamaindex framework tests |
| 85 | +test-llamaindex *ARGS: |
| 86 | + uv run pytest -m llamaindex -v {{ ARGS }} |
| 87 | + |
| 88 | +# Run gaia2 benchmark tests |
| 89 | +test-gaia2 *ARGS: |
| 90 | + uv run pytest -m gaia2 -v {{ ARGS }} |
| 91 | + |
| 92 | +# Run camel framework tests |
| 93 | +test-camel *ARGS: |
| 94 | + uv run pytest -m camel -v {{ ARGS }} |
| 95 | + |
| 96 | +# ─── Testing — Special Modes ───────────────────────────────────────────────── |
| 97 | + |
| 98 | +# Run slow tests — data downloads + integrity checks (needs network) |
| 99 | +test-slow *ARGS: |
| 100 | + uv run pytest -m "(slow or live) and not credentialed" -v {{ ARGS }} |
| 101 | + |
| 102 | +# Run credentialed tests — live API calls (needs API keys) |
| 103 | +test-credentialed *ARGS: |
| 104 | + uv run pytest -m "credentialed and not smoke" -v {{ ARGS }} |
| 105 | + |
| 106 | +# Run smoke tests — full end-to-end pipeline validation |
| 107 | +test-smoke *ARGS: |
| 108 | + uv run pytest -m smoke -v {{ ARGS }} |
| 109 | + |
| 110 | +# Run fully offline tests (no network access) |
| 111 | +test-offline *ARGS: |
| 112 | + uv run pytest -m "not live" -v {{ ARGS }} |
| 113 | + |
| 114 | +# Run all tests except smoke |
| 115 | +test-all *ARGS: |
| 116 | + uv run pytest -m "not smoke" -v {{ ARGS }} |
| 117 | + |
| 118 | +# ─── All-in-One ─────────────────────────────────────────────────────────────── |
| 119 | + |
| 120 | +# Fix, check, and run default tests |
| 121 | +all: fix typecheck test |
| 122 | + |
| 123 | +# Fix, check, and run all tests including slow (excludes credentialed/smoke) |
| 124 | +all-slow: fix typecheck test-all test-slow |
| 125 | + |
| 126 | +# ─── Coverage ───────────────────────────────────────────────────────────────── |
| 127 | + |
| 128 | +# Run default tests with coverage and print report |
| 129 | +coverage *ARGS: |
| 130 | + uv run coverage run -m pytest -v {{ ARGS }} |
| 131 | + uv run coverage report |
| 132 | + |
| 133 | +# Generate HTML coverage report and open it |
| 134 | +coverage-html: coverage |
| 135 | + uv run coverage html |
| 136 | + open htmlcov/index.html |
| 137 | + |
| 138 | +# ─── Documentation ──────────────────────────────────────────────────────────── |
| 139 | + |
| 140 | +# Serve documentation locally (http://127.0.0.1:8000) |
| 141 | +docs: |
| 142 | + uv run mkdocs serve |
| 143 | + |
| 144 | +# Build documentation with strict checking |
| 145 | +docs-build: |
| 146 | + uv run mkdocs build --strict |
| 147 | + |
| 148 | +# ─── Utilities ──────────────────────────────────────────────────────────────── |
| 149 | + |
| 150 | +# Find tests without any CI-mapped marker (potential orphans) |
| 151 | +orphans: |
| 152 | + #!/usr/bin/env bash |
| 153 | + uv run pytest --collect-only -q -m "not (core or benchmark or interface or slow or live or credentialed or smoke)" && \ |
| 154 | + echo "⚠ Orphaned tests found above — add appropriate markers" || \ |
| 155 | + echo "No orphaned tests found" |
| 156 | + |
| 157 | +# Remove build artifacts and caches |
| 158 | +clean: |
| 159 | + rm -rf .coverage .coverage.* htmlcov/ site/ dist/ .pytest_cache/ |
| 160 | + find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true |
| 161 | + |
| 162 | +# Install pre-commit hooks |
| 163 | +pre-commit: |
| 164 | + uv run pre-commit install |
0 commit comments