|
| 1 | +# Repo Guidance |
| 2 | + |
| 3 | +## Overview |
| 4 | + |
| 5 | +- This repo combines the high-level Python bindings in `python/egglog/`, the Rust extension in `src/`, and the Sphinx docs in `docs/`. |
| 6 | +- Public Python APIs are exported from `python/egglog/__init__.py`. |
| 7 | +- The compiled `python/egglog/bindings.cpython-*.so` artifact is generated and should not be edited directly. |
| 8 | + |
| 9 | +## Common Commands |
| 10 | + |
| 11 | +- `uv sync --all-extras` installs the full dev environment. |
| 12 | +- `uv sync --reinstall-package egglog --all-extras` rebuilds the Rust extension after changes in `src/`. |
| 13 | +- `uv run pytest --benchmark-disable -q` runs the Python tests without benchmark calibration. |
| 14 | +- `make mypy` runs the type checker. |
| 15 | +- `make stubtest` checks the runtime against the type stubs. |
| 16 | +- `make docs` builds the docs. |
| 17 | + |
| 18 | +## Docs |
| 19 | + |
| 20 | +- Use the Context7 MCP server for egglog documentation instead of copying external doc summaries into this file. |
| 21 | +- Keep general workflows in the how-to guides, and keep Python-specific runtime/reference examples in `docs/reference/python-integration.md`. |
| 22 | +- If a PR adds or updates a changelog entry in `docs/changelog.md`, keep it aligned with the final code changes. |
| 23 | +- For a clean docs rebuild, clear `docs/_build/`; the MyST-NB execution cache lives in `docs/_build/.jupyter_cache`. |
| 24 | + |
| 25 | +## Python bindings |
| 26 | + |
| 27 | +- Prefer relative imports inside `python/egglog`. |
| 28 | +- When changing public high-level APIs, update the public docs, stubs, and pretty/freeze round-trip expectations together. |
| 29 | +- Higher-order callable type probing should stay isolated from the live ruleset: copy declarations and run with no current ruleset so inference does not register temporary unnamed functions or rewrites. |
| 30 | + |
| 31 | +## Array API |
| 32 | + |
| 33 | +- Start with `python/egglog/exp/array_api.py` and `python/tests/test_array_api.py`. |
| 34 | +- `Vec[...]` is a primitive sort; avoid rewrites or unions that merge distinct vec values. |
| 35 | +- Guard vector indexing rewrites with explicit bounds checks. |
| 36 | + |
| 37 | +## CI |
| 38 | + |
| 39 | +- When debugging GitHub Actions logs, prefer the private `$github-actions-rest-logs` skill or the equivalent REST API flow with `GITHUB_PAT_TOKEN`. |
| 40 | + |
| 41 | +## Verification |
| 42 | + |
| 43 | +- Prefer the minimal code change and the minimal diff that solves the task; only broaden the change if the smaller fix is not sufficient. |
| 44 | +- Run `make mypy` for typing changes. |
| 45 | +- Run targeted pytest for touched modules. |
| 46 | +- Run `make docs` for docs or public API changes. |
0 commit comments