We welcome contributions to the Hanzo Python SDK! This document provides guidelines for contributing to the project.
By participating in this project, you agree to abide by our Code of Conduct:
- Be respectful and inclusive
- Welcome newcomers and help them get started
- Focus on constructive criticism
- Accept feedback gracefully
- Python 3.10 or higher
uvpackage manager- Git
-
Fork the repository
-
Clone your fork:
git clone https://github.com/your-username/python-sdk.git cd python-sdk -
Install dependencies:
make setup
-
Create a feature branch:
git checkout -b feature/your-feature-name
We use ruff for linting and formatting:
# Format code
make format
# Check linting
make lint
# Type checking
make type-checkAll contributions must include tests:
# Run all tests
make test
# Run specific package tests
cd pkg/hanzo && pytest tests/
# Run with coverage
pytest tests/ --cov=hanzo --cov-report=html- Update README files for any new features
- Add docstrings to all public functions/classes
- Include usage examples in docstrings
- Update API documentation if needed
- Check existing issues first
- Create a new issue for bugs or features
- Get feedback before starting major work
- Write clean, readable code
- Follow existing patterns and conventions
- Keep commits small and focused
- Write descriptive commit messages
We follow conventional commits:
type(scope): description
[optional body]
[optional footer]
Types:
feat: New featurefix: Bug fixdocs: Documentationstyle: Code style changesrefactor: Code refactoringtest: Test changeschore: Build/tooling changes
Examples:
feat(agents): add parallel execution support
fix(mcp): resolve file permission issue
docs(network): update API documentation-
Push your branch:
git push origin feature/your-feature-name
-
Create a pull request on GitHub
-
Fill out the PR template:
- Describe what changes you made
- Link related issues
- Include test results
- Add screenshots if applicable
-
Wait for review and address feedback
- Maintain OpenAI compatibility
- Preserve backward compatibility
- Document breaking changes
- Keep commands intuitive
- Provide helpful error messages
- Include --help for all commands
- Follow MCP specification
- Ensure tool safety
- Document permissions required
- Keep agents focused and specialized
- Provide clear agent descriptions
- Include usage examples
- Ensure thread safety
- Handle network failures gracefully
- Document resource requirements
- Test individual functions/methods
- Mock external dependencies
- Aim for >80% coverage
- Test component interactions
- Use real services when possible
- Mark with
@pytest.mark.integration
- Test complete workflows
- Run in CI/CD pipeline
- Document test scenarios
- Correctness: Does it work as intended?
- Tests: Are there adequate tests?
- Documentation: Is it well-documented?
- Style: Does it follow our conventions?
- Performance: Are there any bottlenecks?
- Security: Are there security concerns?
- Initial review: Within 2-3 business days
- Follow-up reviews: Within 1-2 business days
- Small fixes: Same day if possible
- Version Bump: Update version in
pyproject.toml - Changelog: Update CHANGELOG.md
- Testing: Run full test suite
- Documentation: Update docs if needed
- Tag: Create version tag
- Release: Publish to PyPI
- General questions: support@hanzo.ai
- Security issues: security@hanzo.ai
- Partnership: partners@hanzo.ai
Contributors are recognized in:
- CONTRIBUTORS.md file
- Release notes
- Project documentation
By contributing, you agree that your contributions will be licensed under the Apache License 2.0.
Thank you for contributing to Hanzo! 🎉