Contributing to Vyte¶
Thank you for your interest in contributing to Vyte! This document provides guidelines and instructions for contributing.
๐ฏ Code of Conduct¶
By participating in this project, you agree to maintain a respectful and inclusive environment for everyone.
๐ Getting Started¶
Prerequisites¶
- Python 3.11 or higher
- Git
- pip
Setting Up Development Environment¶
- Fork and Clone the Repository
- Create a Virtual Environment
- Install Dependencies
- Verify Installation
๐ Development Workflow¶
1. Create a Branch¶
Branch naming conventions:
feature/- New featuresfix/- Bug fixesdocs/- Documentation changesrefactor/- Code refactoringtest/- Test additions/changes
2. Make Your Changes¶
- Write clean, readable code
- Follow PEP 8 style guidelines
- Add docstrings to functions and classes
- Keep functions focused and small
3. Write Tests¶
- Add tests for new features
- Ensure existing tests pass
- Aim for >80% code coverage
# Run tests
pytest
# Run tests with coverage
pytest --cov=vyte --cov-report=html
# Run specific test file
pytest tests/test_cli.py
4. Format and Lint¶
# Format code with black
black .
# Lint with ruff
ruff check .
# Type check with mypy (if configured)
mypy vyte
5. Commit Your Changes¶
Use clear, descriptive commit messages:
Commit message format:
feat:- New featurefix:- Bug fixdocs:- Documentation changesstyle:- Code style changes (formatting, etc.)refactor:- Code refactoringtest:- Test additions/changeschore:- Maintenance tasks
6. Push and Create Pull Request¶
Then create a Pull Request on GitHub with:
- Clear title and description
- Reference to related issues
- Screenshots (if applicable)
- Testing details
๐งช Testing Guidelines¶
Test Structure¶
def test_feature_name():
"""
Test description explaining what is being tested
"""
# Arrange
setup_code()
# Act
result = function_to_test()
# Assert
assert result == expected_value
Test Coverage¶
- Unit tests for individual functions
- Integration tests for component interactions
- End-to-end tests for complete workflows
Running Tests¶
# All tests
pytest
# Specific test file
pytest tests/test_cli.py
# Specific test function
pytest tests/test_cli.py::test_cli_help
# With verbose output
pytest -v
# Stop on first failure
pytest -x
# Run only integration tests
pytest -m integration
# Skip integration tests
pytest -m "not integration"
๐ Documentation¶
Code Documentation¶
- Add docstrings to all public functions and classes
- Follow Google or NumPy docstring format
- Include examples in docstrings when helpful
Example:
def create_project(config: ProjectConfig) -> Path:
"""
Create a new project from configuration.
Args:
config: Project configuration containing name, framework, etc.
Returns:
Path to the created project directory.
Raises:
ValueError: If configuration is invalid.
FileExistsError: If project directory already exists.
Example:
>>> config = ProjectConfig(name="my-api", framework="FastAPI")
>>> path = create_project(config)
>>> print(path)
/path/to/my-api
"""
pass
Documentation Files¶
When updating documentation:
- Update relevant
.mdfiles indocs/ - Update
README.mdif needed - Keep examples up-to-date
๐ Reporting Bugs¶
Before Reporting¶
- Check existing issues
- Verify you're using the latest version
- Try to reproduce with minimal example
Bug Report Template¶
**Description**
Clear description of the bug
**To Reproduce**
Steps to reproduce:
1. Run command '...'
2. See error
**Expected Behavior**
What should happen
**Actual Behavior**
What actually happens
**Environment**
- OS: [e.g., Windows 11, Ubuntu 22.04]
- Python Version: [e.g., 3.11.5]
- Vyte Version: [e.g., 2.0.4]
**Additional Context**
Any other relevant information
โจ Feature Requests¶
We welcome feature suggestions! Please provide:
- Use Case: Why is this feature needed?
- Description: What should the feature do?
- Examples: How would users interact with it?
- Alternatives: What alternatives have you considered?
๐จ Code Style¶
Python Style¶
- Follow PEP 8
- Use type hints
- Maximum line length: 100 characters
- Use meaningful variable names
# Good
def generate_project(config: ProjectConfig) -> Path:
project_path = Path(config.name)
return project_path
# Avoid
def gen(c):
p = Path(c.name)
return p
Imports¶
Organize imports in this order:
- Standard library
- Third-party packages
- Local imports
import sys
from pathlib import Path
import click
from rich.console import Console
from ..core.config import ProjectConfig
from .display import show_welcome
๐ Code Review Process¶
What We Look For¶
- Code quality and clarity
- Test coverage
- Documentation
- Performance considerations
- Security implications
- Breaking changes
Review Timeline¶
- Initial review: Within 3-5 days
- Follow-up reviews: Within 2 days
- Approval requires: 1 maintainer approval
๐ฆ Release Process¶
Version Numbering¶
We follow Semantic Versioning (SemVer):
MAJOR.MINOR.PATCH- MAJOR: Breaking changes
- MINOR: New features (backward compatible)
- PATCH: Bug fixes
Release Checklist¶
- Update version in
vyte/__version__.py - Update
CHANGELOG.md - Run full test suite
- Update documentation
- Create release tag
- Publish to PyPI
๐ค Community¶
Getting Help¶
- GitHub Issues: Bug reports and features
- Discussions: Questions and community chat
- Email: Domi@usal.es
Recognition¶
Contributors are recognized in:
- Release notes
CONTRIBUTORS.mdfile- GitHub contributors page
๐ License¶
By contributing, you agree that your contributions will be licensed under the MIT License.
Thank you for contributing to Vyte! ๐
Your efforts help make Python API development faster and easier for everyone.