Contributing to Ondine¶
Thank you for your interest in contributing to Ondine!
Quick Start¶
-
Fork and Clone
-
Set Up Development Environment
-
Create a Branch
Development Workflow¶
Running Tests¶
# Run all tests
uv run pytest
# Run with coverage
uv run pytest --cov=ondine --cov-report=html
# Run specific test file
uv run pytest tests/unit/test_pipeline_builder.py
# Run with verbose output
uv run pytest -v
Code Quality¶
# Format code
uv run ruff format ondine/ tests/
# Lint code
uv run ruff check ondine/ tests/
# Type check
uv run mypy ondine/
# Run all quality checks
just lint
Using Justfile¶
We provide a justfile for common tasks:
# Run tests
just test
# Run tests with coverage
just test-coverage
# Format and lint
just format
just lint
# Run all checks
just check
# View all available commands
just --list
Code Guidelines¶
Style¶
- Follow PEP 8 and the Zen of Python
- Use type hints for all function signatures
- Keep functions small and focused (KISS principle)
- Write self-documenting code with clear variable names
Testing¶
- Write tests for all new features (TDD encouraged)
- Maintain or improve test coverage (currently 95%+)
- Include both unit and integration tests where appropriate
- Use descriptive test names:
test_<what>_<when>_<expected>
Documentation¶
- Update README.md if adding user-facing features
- Add docstrings to all public functions and classes
- Include examples for new features in
examples/directory - Update CHANGELOG.md following Keep a Changelog
Commits¶
- Write clear, descriptive commit messages
- Use conventional commits format:
feat:- New featurefix:- Bug fixdocs:- Documentation changestest:- Test additions or changesrefactor:- Code refactoringchore:- Maintenance tasks
Example:
feat: add support for custom retry strategies
- Implement RetryStrategy interface
- Add exponential backoff with jitter
- Update documentation
Architecture¶
Ondine follows a 5-layer clean architecture:
- Core - Domain models and business logic
- Adapters - External integrations (LLM clients, I/O)
- Stages - Pipeline processing stages
- Orchestration - Execution strategies and state management
- API - Public interfaces (builders, composers)
Plugin System¶
Ondine uses decorators for extensibility:
@provider- Register custom LLM providers@stage- Register custom pipeline stages
See examples/15_custom_llm_provider.py and examples/16_custom_pipeline_stage.py for details.
Adding New Features¶
Adding a New LLM Provider¶
- Create a new class inheriting from
BaseLLMProvider - Implement
invoke()andestimate_tokens()methods - Register with
@provider("your_provider_name") - Add tests in
tests/unit/test_providers.py - Add example in
examples/ - Update README.md
Adding a New Pipeline Stage¶
- Create a new class inheriting from
PipelineStage - Implement
execute()method - Register with
@stage("your_stage_name") - Add tests in
tests/unit/test_stages.py - Add example in
examples/ - Update documentation
Reporting Bugs¶
- Check if the bug is already reported in Issues
- If not, create a new issue with:
- Clear title and description
- Steps to reproduce
- Expected vs actual behavior
- Environment details (OS, Python version, Ondine version)
- Minimal reproducible example
Suggesting Features¶
- Check existing feature requests
- Open a new issue with:
- Clear use case description
- Proposed API or interface
- Example usage
- Why this would benefit users
Pull Request Process¶
- Before submitting:
- Ensure all tests pass:
just test - Run code quality checks:
just check - Update documentation if needed
-
Add entry to CHANGELOG.md
-
Submit PR:
- Write a clear title and description
- Reference related issues (e.g., "Fixes #123")
- Ensure CI passes (tests, linting, security)
-
Respond to code review feedback
-
After approval:
- Maintainers will merge your PR
- Your contribution will be included in the next release!
Good First Issues¶
Look for issues labeled good first issue - these are great for newcomers!
Getting Help¶
- Questions? Open a Discussion
- Bugs? Open an Issue
- Chat? Join our community (link coming soon)
Code of Conduct¶
- Be respectful and inclusive
- Welcome newcomers
- Focus on constructive feedback
- Help others learn and grow
Thank You!¶
Every contribution, no matter how small, makes Ondine better. We appreciate your time and effort!
Happy coding!