mirror of
https://github.com/Cinnamon/kotaemon.git
synced 2026-09-01 19:51:37 +02:00
2.3 KiB
2.3 KiB
Repository Guidelines
Project Structure & Module Organization
libs/kotaemon/: core Python library (agents, loaders, LLM/embedding integrations, storage, indexing).libs/ktem/: web app/UI package and app-level services (ktem/main.py,ktem/pages/*, assets).app.py,sso_app.py,sso_app_demo.py: runtime entry points.libs/kotaemon/tests/andlibs/ktem/ktem_tests/: unit/integration tests.docs/: MkDocs content;scripts/: setup/update/runtime utilities;templates/: cookiecutter templates.
Build, Test, and Development Commands
pip install -e "libs/kotaemon[dev]" && pip install -e "libs/ktem": install editable dev dependencies.python app.py: run the default local Gradio app.bash scripts/run_linux.sh(orrun_macos.sh/run_windows.bat): OS-specific bootstrap/run flow.pre-commit run --all-files: run formatting, linting, typing, and safety hooks.pytest libs/kotaemon/tests libs/ktem/ktem_tests: run test suites.
Coding Style & Naming Conventions
- Target Python
>=3.11. - Format with
black(line length88) andisort --profile black. - Lint with
flake8(--max-line-length 88 --extend-ignore E203). - Type-check with
mypy(configured in pre-commit with--check-untyped-defs). - Use
snake_casefor modules/functions,PascalCasefor classes,UPPER_SNAKE_CASEfor constants.
Testing Guidelines
- Framework:
pytest(seelibs/kotaemon/pytest.ini; minimum version7.4). - Test files should be named
test_*.py; keep fixtures inconftest.py. - Add/adjust tests in the package you changed (
libs/kotaemon/testsorlibs/ktem/ktem_tests). - No explicit coverage gate is defined; include regression tests for bug fixes and new behavior.
Commit & Pull Request Guidelines
- Follow Conventional Commit style seen in history:
feat: ...,fix: ...,tests: ...,docs: .... - Keep PR titles compliant with commit convention (squash merge uses PR title as final commit).
- PRs should include: concise change summary, linked issue(s), and screenshots/GIFs for UI changes.
- Ensure CI is green: pre-commit checks, tests, and PR title validation.
Security & Configuration Tips
- Copy
.env.exampleto.envfor local config; never commit secrets. - Pre-commit includes secret checks (
detect-aws-credentials,detect-private-key) and large-file checks.