Contributing

Contributions are welcome! This guide will help you get started.

Development Setup

Prerequisites

  • Python 3.10, 3.11, or 3.12

  • uv - Fast Python package manager

Getting Started

  1. Fork and clone the repository:

    git clone https://github.com/YOUR_USERNAME/baseweb.git
    cd baseweb
    
  2. Install dependencies:

    uv sync --all-extras
    

    This creates a .venv and installs all dependencies including dev and docs tools.

  3. Run tests to verify setup:

    uv run pytest
    

Development Workflow

Running Tests

uv run pytest                    # Run all tests
uv run pytest -v                 # Verbose output
uv run pytest --cov=src          # With coverage

Or use Makefile:

make test

Multi-Version Testing

Test across all supported Python versions (3.10, 3.11, 3.12):

# Install all Python versions first (one-time setup)
make install-pythons

# Run tests on all versions
uv run tox

# Or run specific version
uv run tox -e py310
uv run tox -e py311
uv run tox -e py312

Code Quality

uv run ruff check src tests       # Lint
uv run ruff format src tests      # Format
uv run mypy src                   # Type check

Or use Makefile:

make lint
make format
make typecheck
make check        # All checks

Building Documentation

cd docs
uv run sphinx-build -M html . _build

Or from the project root:

make docs

Pull Request Process

  1. Create an issue to discuss your change

  2. Fork the repository

  3. Create a feature branch

  4. Make your changes

  5. Run tests and linting: make check

  6. Submit a pull request against master

Code Style

  • Follow PEP 8 (enforced by ruff)

  • Use 2 spaces for indentation

  • Add type hints where appropriate

  • Write tests for new functionality

Questions?

Open an issue if you have questions.