-
Notifications
You must be signed in to change notification settings - Fork 0
Contributing Guide
SpyC0der77 edited this page Nov 23, 2024
·
1 revision
Thank you for your interest in contributing to VidKit! This guide will help you get started with contributing to the project.
-
Fork the repository:
- Visit VidKit on GitHub
- Click the "Fork" button
-
Clone your fork:
git clone https://github.com/YOUR_USERNAME/vidkit.git cd vidkit
-
Set up development environment:
# Create virtual environment python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate # Install development dependencies pip install -e ".[dev]"
# Run all tests
python test.py
# Run specific test
python -m unittest test.py -k test_video_generation
- Follow PEP 8 guidelines
- Use type hints where possible
- Document all functions and classes
- Keep functions focused and small
- Write descriptive variable names
Example:
from typing import Dict, Any
def process_config(config: Dict[str, Any]) -> Dict[str, Any]:
"""
Process and validate video configuration.
Args:
config: Dictionary containing video configuration
Returns:
Processed configuration dictionary
Raises:
ValueError: If configuration is invalid
"""
# Implementation
pass
- Update docstrings for any new functions
- Add type hints
- Include examples in docstrings
- Update README.md if needed
- Add new wiki pages for major features
- Write tests for new features
- Update existing tests when changing behavior
- Ensure all tests pass before submitting PR
- Add edge cases to tests
Example test:
import unittest
from vidkit import renderVideo
class TestVideoGeneration(unittest.TestCase):
def test_invalid_config(self):
"""Test that invalid config raises ValueError"""
invalid_config = {
"name": "test",
# Missing required fields
}
with self.assertRaises(ValueError):
renderVideo(invalid_config)
-
Create a new branch:
git checkout -b feature/your-feature-name
-
Make your changes:
- Write code
- Add tests
- Update documentation
-
Commit your changes:
git add . git commit -m "Add feature: description"
-
Push to your fork:
git push origin feature/your-feature-name
-
Create Pull Request:
- Go to the original repository
- Click "New Pull Request"
- Select your branch
- Fill out the PR template
- Code follows style guidelines
- Tests are added/updated
- Documentation is updated
- All tests pass
- PR description explains changes
- Version number updated if needed
- Update version number in
setup.py
- Update CHANGELOG.md
- Create release notes
- Tag release in git
- Build and upload to PyPI
Example version bump:
# setup.py
setup(
name="vidkit",
version="0.1.3", # Increment version
...
)
- Be respectful and inclusive
- Help others when possible
- Report bugs and issues
- Follow code of conduct
- Ask questions in discussions
- Open an issue for bugs
- Use discussions for questions
- Join our community chat
- Contact maintainers
By contributing, you agree that your contributions will be licensed under the MIT License.