Thank you for your interest in contributing to VideoAnnotator! This document provides guidelines and instructions for contributing to the project.
- Code of Conduct
- Getting Started
- Development Setup
- Testing Standards
- Code Style
- Pull Request Process
- Issue Reporting
- Development Workflow
- Documentation
- Release Process
This project adheres to a code of conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to the project maintainers.
- Python 3.8 or higher
- Git
- FFmpeg (for video processing)
- Optional: Docker for containerized development
-
Fork the repository on GitHub
-
Clone your fork locally:
git clone https://github.com/YOUR_USERNAME/VideoAnnotator.git cd VideoAnnotator -
Add the upstream repository:
git remote add upstream https://github.com/ORIGINAL_OWNER/VideoAnnotator.git
Use the Makefile for quick development setup:
make dev-setupThis will:
- Install the package in development mode
- Set up pre-commit hooks
- Install all development dependencies
-
Create a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -e .[dev]
-
Set up pre-commit hooks:
pre-commit install
-
Verify installation:
make test-unit
For Docker-based development:
docker-compose --profile dev up --buildPlease follow our comprehensive testing standards outlined in TESTING_STANDARDS.md.
# Run all tests
make test
# Run specific test categories
make test-unit
make test-integration
make test-performance
# Run tests with coverage
pytest tests/ --cov=src --cov-report=html- All new features must include unit tests
- Integration tests for pipeline components
- Performance tests for critical paths
- Tests must pass in all supported Python versions (3.8-3.11)
- Minimum code coverage: 80%
We use automated code formatting:
# Format code
make format
# Check formatting
black --check src tests examples
isort --check-only src tests examples# Run linting
make lint
# Type checking
make type-check
# All quality checks
make quality-check- Follow PEP 8 style guide
- Use type hints for all functions and methods
- Write docstrings in Google style
- Maximum line length: 88 characters
- Use meaningful variable and function names
"""Module docstring describing the module's purpose."""
from typing import Dict, List, Optional
import logging
logger = logging.getLogger(__name__)
class ExampleClass:
"""Example class demonstrating style guidelines.
Args:
param1: Description of parameter 1
param2: Description of parameter 2
"""
def __init__(self, param1: str, param2: Optional[int] = None) -> None:
"""Initialize the example class."""
self.param1 = param1
self.param2 = param2
def process_data(self, data: List[Dict[str, str]]) -> List[str]:
"""Process input data and return processed results.
Args:
data: List of dictionaries containing input data
Returns:
List of processed string results
Raises:
ValueError: If data is empty or invalid
"""
if not data:
raise ValueError("Data cannot be empty")
results = []
for item in data:
processed = self._process_item(item)
results.append(processed)
return results
def _process_item(self, item: Dict[str, str]) -> str:
"""Private method to process individual items."""
# Implementation details
pass-
Ensure your fork is up to date:
git fetch upstream git checkout main git merge upstream/main
-
Create a feature branch:
git checkout -b feature/your-feature-name
-
Make your changes following the guidelines above
-
Run the full test suite:
make dev-cycle
- Title: Use a clear, descriptive title
- Description: Provide a detailed description of changes
- Tests: Include appropriate tests for new features
- Documentation: Update documentation if needed
- Breaking Changes: Clearly mark any breaking changes
## Description
Brief description of the changes made.
## Type of Change
- [ ] Bug fix (non-breaking change that fixes an issue)
- [ ] New feature (non-breaking change that adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Documentation update
## Testing
- [ ] Unit tests added/updated
- [ ] Integration tests added/updated
- [ ] All tests pass locally
- [ ] Code coverage maintained/improved
## Checklist
- [ ] Code follows project style guidelines
- [ ] Self-review of code completed
- [ ] Documentation updated
- [ ] Changes tested on different platforms (if applicable)Use the bug report template with:
- Clear, descriptive title
- Steps to reproduce
- Expected vs actual behavior
- Environment details (OS, Python version, etc.)
- Relevant logs or screenshots
Use the feature request template with:
- Clear description of the feature
- Use case and motivation
- Proposed implementation (if any)
- Alternatives considered
Include:
- Detailed performance metrics
- System specifications
- Profiling results (if available)
- Comparison with expected performance
feature/description- New featuresbugfix/description- Bug fixeshotfix/description- Critical fixesrefactor/description- Code refactoringdocs/description- Documentation updates
Follow conventional commits:
<type>(<scope>): <description>
[optional body]
[optional footer]
Types:
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style changesrefactor: Code refactoringtest: Test changeschore: Maintenance tasks
Examples:
feat(face_analysis): add emotion detection with DeepFace
fix(audio_pipeline): resolve memory leak in batch processing
docs(installation): update Docker setup instructions
- Automated Checks: All CI checks must pass
- Manual Review: Code review by maintainers
- Testing: Reviewer tests the changes
- Approval: At least one maintainer approval required
- Merge: Squash and merge to main branch
- Use Google-style docstrings
- Include examples in docstrings
- Document all public APIs
- Update documentation for changes
- Update README.md for significant changes
- Add examples to the examples/ directory
- Update configuration documentation
- Create tutorials for new features
make docs
make serve-docsWe follow semantic versioning (SemVer):
MAJOR.MINOR.PATCH- Major: Breaking changes
- Minor: New features (backward compatible)
- Patch: Bug fixes (backward compatible)
- Update version in
pyproject.toml - Update
CHANGELOG.md - Run full test suite
- Create release PR
- Tag release after merge
- Publish to PyPI (automated)
- Create GitHub release
- General Questions: GitHub Discussions
- Bug Reports: GitHub Issues
- Feature Requests: GitHub Issues
- Security Issues: Email maintainers directly
Contributors are recognized in:
CONTRIBUTORS.mdfile- GitHub contributors page
- Release notes for significant contributions
VS Code Extensions:
- Python
- Black Formatter
- isort
- Pylance
- GitLens
- Docker
PyCharm:
- Configure Black as external tool
- Enable type checking
- Set up run configurations
# Run with debug logging
python main.py --log-level DEBUG
# Debug specific pipeline
python -m pdb examples/test_individual_pipelines.py# Profile performance
python -m cProfile -o profile.stats main.py
# Analyze with snakeviz
snakeviz profile.stats- Create pipeline class in
src/pipelines/ - Implement
BasePipelineinterface - Add configuration schema
- Create unit tests
- Add integration tests
- Update documentation
- Add example usage
- Add to
pyproject.toml - Update
requirements.txt - Test installation
- Update documentation
- Test new model performance
- Update configuration options
- Add backward compatibility
- Update documentation
- Add performance benchmarks
Thank you for contributing to VideoAnnotator! Your contributions help make video analysis more accessible and powerful for everyone.