Skip to content

๐Ÿš€ Contributing to EasySwitch

Thank you for your interest in contributing to EasySwitch! This guide will help you contribute effectively while maintaining our quality standards.


๐Ÿ” Prerequisites

  • Python 3.10+
  • UV (recommended) or pip
  • Basic knowledge of payment APIs
  • Familiarity with async testing

๐Ÿ’ป Local Setup

1. Fork the Repository

Click "Fork" at the top-right of the project's GitHub page.

2. Clone the Project

git clone https://github.com/your-username/easyswitch.git
cd easyswitch

3. Set Up the Environment

With UV (recommended):

# Install UV
pip install uv

# Create virtual environment
uv venv

# Activate environment
source venv/bin/activate  # Linux/Mac
# OR
.\venv\Scripts\activate   # Windows

# Install dependencies
uv pip install -e .

With standard pip:

python -m venv venv
source venv/bin/activate
pip install -e .


๐Ÿ”„ Contribution Workflow

  1. Create a Branch

    git checkout -b feat/new-feature
    

  2. Implement Your Changes

  3. Follow code conventions
  4. Add relevant tests

  5. Verify Code Quality

    uv run lint   # Style check
    uv run test   # Run tests
    

  6. Push Changes

    git push origin feat/new-feature
    

  7. Open a Pull Request

  8. Complete the PR template
  9. Clearly describe your changes
  10. Reference related issues

โœจ Code Conventions

General Structure

  • Typing: Use type annotations everywhere
  • Async: Prefer async/await for I/O operations
  • Exceptions: Use the project's custom exceptions

Style Guide

  • Naming:
  • Variables/functions: snake_case
  • Classes: PascalCase
  • Constants: UPPER_CASE
  • Docstrings: Follow Google Style
    def send_payment(amount: float) -> bool:
        """Sends payment to the aggregator.
    
        Args:
            amount: Amount to send (in XOF)
    
        Returns:
            bool: True if payment succeeded
        """
    

Validation

  • Use validators from easyswitch.utils.validators
  • Always validate API inputs

๐Ÿงช Testing & Quality

Running Tests

uv run test  # All tests
uv run test -k "test_payment"  # Specific tests

Code Coverage

uv run coverage

Best Practices

  • 1 test per feature
  • Isolated, idempotent tests
  • Mock external APIs

๐Ÿ› Issue Management

Reporting Bugs

  1. Check for existing issues
  2. Use the "Bug Report" template
  3. Include:
  4. Environment (Python, OS)
  5. Reproduction steps
  6. Relevant logs/errors

Feature Proposals

  1. Use the "Feature Request" template
  2. Describe:
  3. Use case
  4. Expected impact
  5. API sketch if applicable

๐Ÿค Code of Conduct

We adhere to the Contributor Covenant Code of Conduct. By participating: - Be kind and open-minded - Accept constructive feedback - Prioritize collaboration


๐ŸŽ‰ First-Time Contributor?

Check out these labeled issues: - good first issue for simple contributions - help wanted for more challenging tasks


Thank you for helping make EasySwitch even better! ๐Ÿ’ช