- This repo combines the high-level Python bindings in
python/egglog/, the Rust extension insrc/, and the Sphinx docs indocs/. - Public Python APIs are exported from
python/egglog/__init__.py. - The compiled
python/egglog/bindings.cpython-*.soartifact is generated and should not be edited directly.
uv sync --all-extrasinstalls the full dev environment.uv sync --reinstall-package egglog --all-extrasrebuilds the Rust extension after changes insrc/.uv run pytest --benchmark-disable -qruns the Python tests without benchmark calibration.make mypyruns the type checker.make stubtestchecks the runtime against the type stubs.make docsbuilds the docs.
- Use the Context7 MCP server for egglog documentation instead of copying external doc summaries into this file.
- Keep general workflows in the how-to guides, and keep Python-specific runtime/reference examples in
docs/reference/python-integration.md. - Before changing Python-facing
egglogAPIs or expression-inspection patterns, readdocs/reference/python-integration.md. - Before changing how egglog concepts map into Python declarations, relations, actions, or sort/function definitions, read
docs/reference/egglog-translation.md. - If a change touches both local Python ergonomics and egglog-language mapping, read
docs/reference/python-integration.mdfirst, thendocs/reference/egglog-translation.md. - If a PR adds or updates a changelog entry in
docs/changelog.md, keep it aligned with the final code changes. - For a clean docs rebuild, clear
docs/_build/; the MyST-NB execution cache lives indocs/_build/.jupyter_cache.
- Prefer relative imports inside
python/egglog. - When changing public high-level APIs, update the public docs, stubs, and pretty/freeze round-trip expectations together.
- 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.
- Start with
python/egglog/exp/array_api.pyandpython/tests/test_array_api.py. Vec[...]is a primitive sort; avoid rewrites or unions that merge distinct vec values.- Guard vector indexing rewrites with explicit bounds checks.
- When debugging GitHub Actions logs, prefer the private
$github-actions-rest-logsskill or the equivalent REST API flow withGITHUB_PAT_TOKEN.
- Prefer the minimal code change and the minimal diff that solves the task; only broaden the change if the smaller fix is not sufficient.
- For long-running profiling or trace probes, run them with explicit timeouts, check for lingering worker processes before and after, and inspect memory usage after any timeout or manual kill before starting the next experiment.
- Run
make mypyfor typing changes. - Run targeted pytest for touched modules.
- Run
make docsfor docs or public API changes.