← Back to index

Contributing to pywaifu

Thank you for your interest in contributing to pywaifu! This document provides guidelines for contributing to the project.

Development Setup

  1. Fork and Clone the Repository

    git clone https://github.com/waifuai/waifu-llm-vrm.git
    cd pywaifu
    
  2. Set Up Development Environment

    # Create virtual environment
    python -m uv venv .venv
    
    # Activate environment
    source .venv/Scripts/activate  # On Windows: .venv\Scripts\activate
    
    # Install development dependencies
    python -m uv pip install -r requirements-dev.txt
    
  3. Set Up Pre-commit Hooks

    # Install pre-commit
    python -m uv pip install pre-commit
    
    # Install hooks
    pre-commit install
    

Development Workflow

  1. Create a Feature Branch

    git checkout -b feature/your-feature-name
    
  2. Make Your Changes

  3. Run Tests

    # Run all tests
    python -m pytest
    
    # Run with coverage
    python -m pytest --cov=src/pywaifu
    
    # Run specific tests
    python -m pytest src/pywaifu/tests/test_character.py
    
  4. Code Quality Checks

    # Format code
    python -m black src/ examples/
    
    # Lint code
    python -m flake8 src/ examples/
    
    # Type checking
    python -m mypy src/
    
  5. Commit Your Changes

    git add .
    git commit -m "feat: add your feature description"
    
  6. Push and Create Pull Request

    git push origin feature/your-feature-name
    

Code Style Guidelines

Python Style

Documentation

Naming Conventions

Error Handling

Testing

Unit Tests

Test Structure

src/pywaifu/tests/
├── __init__.py
├── test_character.py     # Character class tests
├── test_vrm.py          # VRMCharacter class tests
├── test_godot.py        # GodotConnector tests
└── test_utils.py        # Utility function tests

Running Tests

# All tests
pytest

# With coverage
pytest --cov=src/pywaifu --cov-report=html

# Specific test file
pytest src/pywaifu/tests/test_character.py

# Verbose output
pytest -v

Pull Request Process

  1. Title: Use conventional commit format

  2. Description: Provide clear description of changes

  3. Checklist:

Documentation

Updating Documentation

Building Documentation

# Generate Sphinx documentation
cd docs/
make html

Release Process

Versioning

Release Steps

  1. Create release branch
  2. Update version numbers
  3. Update changelog
  4. Run full test suite
  5. Create pull request
  6. Merge to main
  7. Create GitHub release
  8. Publish to PyPI

Community

Getting Help

Code of Conduct

License

By contributing to pywaifu, you agree that your contributions will be licensed under the same license as the project (MIT-0 License).