Skip to content

Latest commit

 

History

History
116 lines (84 loc) · 2.54 KB

File metadata and controls

116 lines (84 loc) · 2.54 KB

Contributing to SignedShot API

Thank you for your interest in contributing to SignedShot API!

Development Setup

Prerequisites

  • Python 3.12+
  • uv for dependency management

Getting Started

  1. Fork and clone the repository:

    git clone https://github.com/YOUR_USERNAME/signedshot-api.git
    cd signedshot-api
  2. Install dependencies:

    uv sync --dev
  3. Set up environment:

    cp .env.example .env
    # Edit .env with your configuration
  4. Run the development server:

    uv run poe dev

Development Workflow

Before Submitting a PR

Run all checks:

uv run poe pre-commit

This runs:

  • lint - Code style checks (ruff)
  • format-check - Formatting verification (ruff)
  • typecheck - Type checking (pyright)
  • test - Unit tests (pytest)

Individual Commands

uv run poe lint              # Check code style
uv run poe format            # Format code
uv run poe typecheck         # Type checking
uv run poe test              # Run unit tests
uv run poe test-cov          # Run unit tests with coverage
uv run poe test-integration  # Run integration tests (requires Docker)
uv run poe test-all          # Run all tests with combined coverage
uv run poe check             # Run all quality checks (lint + format + typecheck)
uv run poe fix               # Auto-fix linting and formatting

Code Style

  • We use ruff for linting and formatting
  • Type hints are required (enforced by pyright in strict mode)
  • Follow existing code patterns

Pull Request Guidelines

  1. Branch naming: Use descriptive branch names

    • feat/add-device-registration
    • fix/session-expiry-bug
    • docs/update-readme
  2. Commit messages: Be clear and concise

    • Use imperative mood ("Add feature" not "Added feature")
    • Reference issues when applicable
  3. PR description: Explain what and why

    • Describe the changes
    • Link related issues
    • Include testing steps if applicable
  4. Keep PRs focused: One feature/fix per PR

Testing

  • Write tests for new functionality
  • Ensure existing tests pass
  • Aim for meaningful coverage, not 100%

Running Tests

# Unit tests
uv run poe test

# Unit tests with coverage
uv run poe test-cov

# Integration tests (requires Docker)
uv run poe test-integration

# All tests with combined coverage
uv run poe test-all

# Specific test file
uv run pytest tests/test_specific.py

Questions?

Open an issue for questions or discussions.