|
| 1 | +# Render Engine API - Just recipes |
| 2 | +# Run tasks with: just <task-name> |
| 3 | + |
| 4 | +DEFAULT_PYTHON_VERSION := "3.14" |
| 5 | + |
| 6 | +# Default recipe to display available commands |
| 7 | +default: |
| 8 | + @just --list |
| 9 | + |
| 10 | +# Sync dependencies using uv |
| 11 | +sync: |
| 12 | + uv sync --dev |
| 13 | + |
| 14 | +# Run pytest |
| 15 | +test *FLAGS='': |
| 16 | + pytest {{ DEFAULT_PYTHON_VERSION }} {{ FLAGS }} |
| 17 | + |
| 18 | +# Install pre-commit hooks |
| 19 | +pre-commit-install: |
| 20 | + uvx pre-commit install |
| 21 | + |
| 22 | +# Run pre-commit on all files |
| 23 | +pre-commit: |
| 24 | + uvx pre-commit run --all-files |
| 25 | + |
| 26 | +# Run pre-commit on staged files (default git behavior) |
| 27 | +pre-commit-run: |
| 28 | + uvx pre-commit run |
| 29 | + |
| 30 | +# Update pre-commit hook versions |
| 31 | +pre-commit-update: |
| 32 | + uvx pre-commit autoupdate |
| 33 | + |
| 34 | +# Run tests in arbitrary Python version. |
| 35 | +pytest VERSION *FLAGS='': |
| 36 | + uv run -p {{ VERSION }} --dev pytest {{ FLAGS }} |
| 37 | + |
| 38 | +# Run pytest with coverage report (defaults to XML) |
| 39 | +test-cov-report REPORT='xml': |
| 40 | + uv run --dev pytest --cov-report={{ REPORT }} |
| 41 | + |
| 42 | +# Run all nox sessions |
| 43 | +nox: |
| 44 | + uvx nox |
| 45 | + |
| 46 | +# Run ruff linter without fixing |
| 47 | +lint DIRECTORY='.': |
| 48 | + uvx ruff check {{ DIRECTORY }} |
| 49 | + |
| 50 | +# Run ruff linter with auto-fix |
| 51 | +lint-fix DIRECTORY='.': |
| 52 | + uvx ruff check --fix {{ DIRECTORY }} |
| 53 | + |
| 54 | +# Run ruff formatter as check |
| 55 | +format DIRECTORY='.': |
| 56 | + uvx ruff format --check {{ DIRECTORY }} |
| 57 | + |
| 58 | +# Run ruff formatter and fix issues |
| 59 | +format-fix DIRECTORY='.': |
| 60 | + uvx ruff format --check {{ DIRECTORY }} |
| 61 | + |
| 62 | +ruff: lint format |
| 63 | + |
| 64 | +# Run both linter and formatter, fixing issues. |
| 65 | +ruff-fix DIRECTORY='.': |
| 66 | + @# Prefacing with `-` to ignore any errors that might be fixed by formatting. |
| 67 | + -uvx ruff check --fix {{ DIRECTORY }} |
| 68 | + uvx ruff format {{ DIRECTORY }} |
| 69 | + uvx ruff check {{ DIRECTORY }} |
| 70 | + @echo "\nEverything looks good!" |
| 71 | + |
| 72 | +# Run ty type checker |
| 73 | +ty PATH='src': |
| 74 | + uv run ty check {{ PATH }} # For the moment we have way too many issues in ty so not having it fail. |
| 75 | + |
| 76 | +# Generate coverage badge |
| 77 | +badge: (test-cov-report 'xml') |
| 78 | + uvx --with "genbadge[coverage]" genbadge coverage -i coverage.xml |
| 79 | + |
| 80 | +# Run full CI workflow (sync, lint, test, badge) |
| 81 | +ci: sync nox ruff ty badge |
0 commit comments