Contributing¶
We welcome contributions to the IVCAP Service SDK!
Getting Started¶
1. Fork and Clone¶
2. Set Up Development Environment¶
3. Create a Branch¶
Development Workflow¶
Running Tests¶
Code Quality¶
# Format code
poetry run ruff format .
# Lint
poetry run ruff check . --fix
# Type checking
poetry run pyright
Building Documentation¶
Visit http://localhost:8000 to preview the docs.
Making Changes¶
Code Changes¶
- Make your changes in a feature branch
- Add tests for new functionality
- Ensure all tests pass:
poetry run pytest - Update documentation as needed
Documentation Changes¶
- Edit files in
docs/docs/ - Test locally:
mkdocs serve - Check formatting and links
- Submit pull request
Commit Messages¶
Use clear, descriptive commit messages:
โจ feat: add new feature
๐ fix: resolve bug
๐ docs: update documentation
๐งช test: add unit tests
๐จ chore: refactor code
Pull Request Process¶
- Update documentation
- Add/update tests
- Ensure CI passes
- Create clear PR description
- Link related issues
Code Style¶
We follow Python PEP 8 with these tools:
- Ruff โ Linting and formatting
- Pyright โ Type checking
- Pytest โ Testing
Style Guide¶
# Docstrings follow Google style
def process_job(req: Request, ctx: JobContext) -> Result:
"""
Process a job.
Args:
req: Request to process
ctx: Job context
Returns:
Processing result
Raises:
ValueError: If validation fails
"""
pass
# Type hints required
def add(a: int, b: int) -> int:
return a + b
# Use meaningful variable names
result = process(data) # Good
x = process(y) # Bad
Testing¶
Write tests for new features:
# tests/test_feature.py
import pytest
from src.feature import my_function
def test_my_function_basic():
result = my_function(5)
assert result == 10
def test_my_function_error():
with pytest.raises(ValueError):
my_function(-1)
Run tests:
Documentation Guidelines¶
- Be clear โ Write for developers new to the SDK
- Include examples โ Every concept should have a code example
- Link between pages โ Use relative links to other docs
- Update TOC โ If adding new pages, update mkdocs.yml
Reporting Issues¶
Bug Reports¶
Include: - Minimal reproducible example - Expected vs actual behavior - Python version and environment - Traceback (if applicable)
Feature Requests¶
Include: - Use case and motivation - Proposed API/syntax - Any alternatives considered
Questions?¶
- GitHub Issues โ For bugs and feature requests
- Discussions โ For questions and ideas
- Email โ For security issues
License¶
By contributing, you agree that your contributions will be licensed under the same LICENSE as the project.
Thank you for contributing to IVCAP! ๐