- Source:
nomos/(core logic incore.py, CLI incli.py, API server inapi/app.py, models inmodels/, LLM providers inllms/, utilities inutils/, tools intools/). - Tests:
tests/(pytest suite, fixtures intests/fixtures/). - Docs & Examples:
docs/, examples/recipes incookbook/. - Dev tooling:
pyproject.toml(ruff, pytest),.pre-commit-config.yaml,Dockerfile.
- Create env & install (dev):
uv sync --group devorpip install -e .[dev]. - Lint:
ruff check .(auto-fix:ruff check . --fix). - Format:
ruff format .. - Type check:
mypy nomos tests. - Run tests:
pytest(uses coverage by default viapyproject.toml). - Fast tests:
pytest -q -n auto(requirespytest-xdist). - Run CLI:
nomos --helporpython -m nomos.cli .... - Run API (dev):
uvicorn nomos.api.app:app --reload.
- Python 3.10+. Indentation: 4 spaces. Line length: 100.
- Names: modules/functions
snake_case, classesPascalCase, constantsUPPER_SNAKE_CASE. - Imports: sorted and grouped (ruff/isort). Prefer explicit exports and type hints; public APIs should be annotated (
py.typedis included). - Keep functions small and composable; avoid side effects in utilities.
- Framework: pytest with coverage (
--cov=nomos --cov-report=term-missingvia config). - Location: place tests under
tests/mirroring package paths; name filestest_*.py. - Use fixtures from
tests/fixtures/; add new ones in that folder when shared. - Aim for meaningful coverage on new/changed code; include API/CLI integration tests when applicable.
- Commits: imperative present (“Add …”, “Fix …”). Keep concise; include scope when helpful. Reference issues/PRs (e.g.,
(#123)). - Pre-push: run
ruff check . --fix && ruff format . && mypy nomos && pytestorpre-commit run -a. - PRs: include clear description, linked issues, screenshots or logs for user-visible changes, and notes on backwards compatibility/config impacts.
- Keep secrets in environment variables;
.envfiles are git-ignored. Never commit keys. - Optional provider extras: install with
pip install .[openai,anthropic,serve,...]oruv sync --extra <name>perpyproject.toml.