Contributing to Trusera SDK
February 12, 2026 ยท View on GitHub
Thank you for your interest in contributing to the Trusera Python SDK! This document provides guidelines and instructions for contributing.
Getting Started
- Fork the repository
- Clone your fork:
git clone https://github.com/YOUR_USERNAME/trusera-agent-sdk.git - Create a branch:
git checkout -b feature/your-feature-name - Make your changes
- Run tests:
pytest - Commit your changes:
git commit -m "Add your feature" - Push to your fork:
git push origin feature/your-feature-name - Open a Pull Request
Development Setup
# Create a virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install in development mode with all dependencies
pip install -e ".[dev,langchain,crewai,autogen]"
Code Standards
Style Guide
We follow PEP 8 and use several tools to enforce code quality:
# Run linter
ruff check .
# Auto-fix issues
ruff check --fix .
# Type checking
mypy trusera_sdk
# Format code (if using black)
black trusera_sdk tests
Type Hints
All functions should have type hints:
def my_function(arg1: str, arg2: int) -> dict[str, Any]:
"""Function with type hints."""
return {"result": arg1 * arg2}
Docstrings
Use Google-style docstrings:
def my_function(arg1: str, arg2: int) -> str:
"""
Brief description of the function.
Longer description if needed.
Args:
arg1: Description of arg1
arg2: Description of arg2
Returns:
Description of return value
Raises:
ValueError: When something goes wrong
"""
pass
Testing
Running Tests
# Run all tests
pytest
# Run specific test file
pytest tests/test_client.py
# Run with coverage
pytest --cov=trusera_sdk --cov-report=html
Writing Tests
- Place tests in the
tests/directory - Name test files
test_*.py - Name test functions
test_* - Use descriptive test names
- Aim for high test coverage (>90%)
Example test:
def test_my_feature(trusera_client):
"""Test my new feature."""
result = trusera_client.my_feature()
assert result is not None
assert result["status"] == "success"
Pull Request Process
- Update Tests: Add or update tests for your changes
- Update Documentation: Update README.md or docstrings as needed
- Run All Tests: Ensure all tests pass
- Check Code Quality: Run linter and type checker
- Write Clear Commit Messages: Use descriptive commit messages
- Update Changelog: Add a note about your changes
- Submit PR: Open a pull request with a clear description
PR Description Template
## Description
Brief description of changes
## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Breaking change
- [ ] Documentation update
## Testing
How has this been tested?
## Checklist
- [ ] Tests pass
- [ ] Code follows style guidelines
- [ ] Documentation updated
- [ ] Changelog updated
Adding Framework Integrations
To add support for a new AI framework:
- Create
trusera_sdk/integrations/your_framework.py - Implement the integration following existing patterns
- Add tests in
tests/test_your_framework.py - Add to
pyproject.tomloptional dependencies - Update README.md with usage example
Reporting Bugs
Open an issue with:
- Clear title
- Steps to reproduce
- Expected behavior
- Actual behavior
- Environment details (Python version, OS, SDK version)
- Code sample if possible
Feature Requests
Open an issue with:
- Clear description of the feature
- Use case / motivation
- Example API if proposing new functionality
Questions
For questions about using the SDK:
- Check the documentation
- Search existing issues
- Open a new issue with the "question" label
License
By contributing, you agree that your contributions will be licensed under the Apache License 2.0.
Code of Conduct
Be respectful and constructive in all interactions.
Thank you for contributing to Trusera!