Contributing¶
We welcome contributions to the IVCAP Lambda 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 mypy ivcap_lambda
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:
cd docs && 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 use:
- Ruff โ Linting and formatting
- Mypy โ Type checking
- Pytest โ Testing
Style Guide¶
# Docstrings follow Google style
def process(req: MyRequest, jobCtxt: JobContext) -> MyResult:
"""Process a request.
Args:
req: The request to process.
jobCtxt: Job context for progress reporting.
Returns:
The processing result.
Raises:
ValueError: If validation fails.
"""
pass
# Type hints required everywhere
def add(a: int, b: int) -> int:
return a + b
Testing¶
Write tests for new features:
# tests/test_feature.py
import pytest
from ivcap_lambda import ivcap_lambda
def test_my_tool():
from my_service import my_tool, MyRequest
req = MyRequest(text="hello")
result = my_tool(req)
assert result.output == "HELLO"
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
- Update mkdocs.yml โ If adding new pages
Reporting Issues¶
Bug Reports¶
Include:
- Minimal reproducible example
- Expected vs actual behavior
- Python version and ivcap-lambda version
- Traceback (if applicable)
Feature Requests¶
Include: - Use case and motivation - Proposed API/syntax - Any alternatives considered
License¶
By contributing, you agree that your contributions will be licensed under the same BSD License as the project.
Thank you for contributing to IVCAP! ๐