Thank you for your interest in contributing!
git clone https://github.com/dgenio/contextweaver
cd contextweaver
pip install -e ".[dev]"
pre-commit installInstalling pre-commit hooks ensures that ruff format, ruff check --fix
(linting with autofix), and standard file hygiene checks run automatically on
every git commit. Hooks may modify files — re-stage with git add if needed.
make fmt # auto-format with ruff
make lint # lint with ruff
make type # type-check with mypy
make test # run tests with pytest
make ci # run all of the above in sequenceAll CI checks must pass before a PR can be merged.
- Fork the repository and create a feature branch from
main. - Make your changes following the style guide below.
- Add or update tests in
tests/. - Run
make ciand ensure it passes. - Update
CHANGELOG.mdunder## [Unreleased]. - Open a pull request with a clear description of the change.
- Python ≥ 3.10 — use
X | Yunion syntax,matchstatements where appropriate. - Zero runtime dependencies — do not add any
install_requiresentries. - Type hints everywhere — all public functions and methods must be fully annotated.
- Docstrings — use Google-style docstrings on all public classes and functions.
- Line length — 100 characters maximum (enforced by ruff).
- Imports —
from __future__ import annotationsat the top of every file. - Module size — target ≤ 300 lines per module (except
__main__.py). - Determinism — all algorithms must be deterministic; tie-break by ID / sorted keys.
- Every new public function must have at least one test.
- Tests live in
tests/test_<module_name>.py. - Use
pytest.mark.asynciofor async tests (asyncio_mode = "auto" is set globally). - Do not mock internal modules; use real in-memory implementations.
- Implement the store class in
src/contextweaver/store/<name>.py. - Export it from
src/contextweaver/store/__init__.py. - Add tests in
tests/test_store_<name>.py. - Update
StoreBundleinstore/__init__.pyif appropriate.