This document covers how we work and what we expect from contributions. For project setup, see the
top-level README. For coding style enforced project-wide (imports, quotes,
docstrings, function-arg formatting, etc.), see assistant-guidelines.md;
those rules apply to human contributors as much as to AI assistants.
- Make it correct, then make it simple, then make it fast.
- Small, focused PRs are easier to review and revert.
- Tests drive quality and confidence; every bug fix or feature ships with tests.
- Determinism is a feature: seed PRNGs and avoid time/environment-sensitive behavior in tests.
- Prefer clear APIs, helpful error messages, and actionable logs.
- Python 3.12+.
uvfor environment management (uses the project'suv.lock).pytest,pre-commit,ruff,pyrightare wired into the Makefile.
-
Open or pick an issue. For larger changes, sketch the approach in the issue first.
-
Branch off
masterwith a descriptive name (e.g.feature/prompt-manager-batching,fix/timeout-handling). -
Keep PRs small and focused. Ship tests and docs in the same PR as the change.
-
Run quality gates locally before pushing. The canonical gate is:
make check # = make lint + make test (ruff + pyright + pre-commit + fast pytest)Useful subsets:
make lint # formatting + linting + type-checking make test # fast pytest (excludes slow/integration/openai) make test-all # everything except openai-tagged tests make coverage-fast / make coverage # mirrors PR / post-merge CI coverage pytest tests/path/to/test_file.py -q pytest -k "token or expression" -q
-
Open the PR. Summarize what changed and why; link the issue. Call out breaking changes, migrations, or behavioral comparisons. Add the
integrationorslowlabel if you want CI to run those slices before merge.
- Use
pytestwith fixtures for shared setup; keep tests isolated. - Prefer small synthetic inputs and runtime-created temp dirs over committed corpora.
- Seed all PRNGs. Don't rely on wall-clock time or sleeps.
- When fixing a bug, reproduce it with a failing test first.
- If a test depends on an external resource (a dataset, an API key), gate it with a skip; see
tests/env_checks.pyfor the existing helpers.
Markers (defined in pyproject.toml; combine as needed). make test deselects everything
except untagged fast tests:
| Marker | Use for | Default |
|---|---|---|
slow |
tests that take more than a few seconds or need heavy compute | excluded |
integration |
end-to-end flows wiring multiple modules (CLIs, Hydra apps, dataset writers) | excluded |
dataset |
tests that need a real local corpus (e.g. TACO); pair with slow/integration |
excluded |
openai |
tests that hit the live OpenAI API (require OPENAI_API_KEY + network) |
excluded |
distributed |
tests that require multi-process / distributed execution | excluded |
- Fail fast with informative exceptions. Avoid try/except blocks whose only purpose is to silence errors; let them propagate to the caller unless control flow genuinely requires recovery.
- Log levels are load-bearing:
DEBUGfor deep diagnostics,INFOfor milestones,WARNING/ERRORfor actionable issues. Default-INFO output should stay readable.
- Never commit secrets, tokens, or real credentials. Use a local
.env(see.env.template). - Keep large datasets and outputs out of the repo; reference them by path or env var.
- Notebook outputs are stripped on commit by an automatic
nbstripoutgit filter installed viamake install. Ifgit addflags a notebook with outputs, runmake setup-nbstripout-tool && make setup-nbstripoutto (re)install the filter. Seenotebooks/README.mdfor details.
pyine/apps/README.md: overview of every CLI/Hydra app, with example invocations and pointers to per-app guides.pyine/configs/README.md: Hydra/Hydra-Zen experiment overlays, search paths, and structured-config registration.pyine/prompts/README.md: prompt template authoring, the prompt manager, and the result DB.pyine/organisms/README.md: datamodules used by the trainers.notebooks/README.md: exploratory and analysis notebooks.scripts/README.md: internal launchers and sweep drivers.