Contributing¶
Thank you for your interest in contributing to Vibe AIGC!
Getting Started¶
Fork and Clone¶
Development Setup¶
# Create virtual environment
python -m venv venv
source venv/bin/activate # or `venv\Scripts\activate` on Windows
# Install with dev dependencies
pip install -e ".[dev]"
# Verify setup
pytest -v
Development Workflow¶
1. Create a Branch¶
2. Make Changes¶
- Write code following the existing style
- Add tests for new functionality
- Update documentation as needed
3. Run Tests¶
# Run all tests
pytest -v
# Run with coverage
pytest --cov=vibe_aigc
# Run specific test file
pytest tests/test_planner.py -v
4. Check Code Quality¶
5. Commit and Push¶
6. Open Pull Request¶
- Go to GitHub and create a PR
- Fill in the PR template
- Wait for CI checks to pass
- Address review feedback
Commit Message Format¶
We use conventional commits:
feat:New featurefix:Bug fixdocs:Documentation changestest:Test changesrefactor:Code refactoringchore:Maintenance tasks
Examples:
feat: add parallel execution for independent nodes
fix: handle empty workflow plans gracefully
docs: update quickstart guide with checkpoint example
Code Style¶
- Use Black for formatting
- Use Ruff for linting
- Add type hints to all public functions
- Write docstrings for public APIs
def my_function(param: str, count: int = 1) -> list[str]:
"""Short description of function.
Longer description if needed.
Args:
param: Description of param
count: Description of count
Returns:
Description of return value
Raises:
ValueError: When something is wrong
"""
pass
Testing Guidelines¶
- Write tests for all new functionality
- Use pytest fixtures for common setup
- Test both success and error cases
- Use async tests for async code:
import pytest
@pytest.mark.asyncio
async def test_my_async_function():
result = await my_async_function()
assert result is not None
Documentation¶
- Update relevant docs when changing functionality
- Add docstrings to new public APIs
- Include code examples where helpful
- Preview docs locally:
Questions?¶
- Open an issue for bugs or feature requests
- Start a discussion for questions
- Check existing issues before creating new ones
License¶
By contributing, you agree that your contributions will be licensed under the MIT License.