Skip to content

Latest commit

 

History

History
145 lines (97 loc) · 3.03 KB

File metadata and controls

145 lines (97 loc) · 3.03 KB

Contributing

We welcome contributions to the Kailash Python SDK! This guide will help you get started.

Getting Started

  1. Fork the Repository

    Visit GitHub and fork the repository.

  2. Clone Your Fork

    git clone https://github.com/YOUR_USERNAME/kailash-py.git
    cd kailash-py
  3. Set Up Development Environment

    # Install uv package manager
    curl -LsSf https://astral.sh/uv/install.sh | sh
    
    # Sync dependencies
    uv sync
    
    # Install pre-commit hooks
    pre-commit install

Development Workflow

  1. Create a Feature Branch

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

    • Write clean, documented code
    • Follow the existing code style
    • Add tests for new functionality
    • Update documentation as needed
  3. Run Tests

    uv run pytest
    uv run pytest --cov=kailash
  4. Check Code Quality

    # Run all pre-commit hooks
    pre-commit run --all-files
    
    # Or run individually
    black src/ tests/
    isort src/ tests/
    ruff check src/ tests/
  5. Commit Your Changes

    git add .
    git commit -m "feat: add new feature"

    Follow conventional commit format: - feat: for new features - fix: for bug fixes - docs: for documentation - test: for tests - refactor: for refactoring

  6. Push and Create Pull Request

    git push origin feature/your-feature-name

    Then create a pull request on GitHub.

Code Style Guidelines

  • Python Style: Follow PEP 8
  • Line Length: 88 characters (Black default)
  • Imports: Use isort for organizing
  • Type Hints: Always use type annotations
  • Docstrings: Use Google style docstrings

Testing Guidelines

  • Write tests for all new functionality
  • Maintain test coverage above 80%
  • Use pytest for all tests
  • Mock external dependencies
  • Test both success and error cases

Documentation

  • Update docstrings for new/modified code
  • Update API documentation if needed
  • Add examples for new features
  • Update README if necessary

Pull Request Process

  1. Ensure all tests pass
  2. Update documentation
  3. Add entry to CHANGELOG.md
  4. Request review from maintainers
  5. Address review feedback
  6. Squash commits if requested

Community Guidelines

  • Be respectful and inclusive
  • Follow the Code of Conduct
  • Help others in issues and discussions
  • Share your use cases and feedback

Getting Help

Thank you for contributing to Kailash Python SDK!