Skip to content

Latest commit

 

History

History
133 lines (90 loc) · 2.19 KB

File metadata and controls

133 lines (90 loc) · 2.19 KB

Contributing to AB

Thank you for contributing to AB! This project is open source and we welcome contributions.

Code of Conduct

Be respectful, inclusive, and constructive. We're all here to build something great together.

Getting Started

Development Setup

Prerequisites

Install uv (fast Python package installer):

# macOS/Linux
curl -LsSf https://astral.sh/uv/install.sh | sh

# Or with Homebrew
brew install uv

Setup

# Clone repository
git clone <repo-url>
cd ab

# Create virtual environment and install dependencies
uv sync

# Activate virtual environment (optional, uv run works without it)
source .venv/bin/activate  # macOS/Linux
.venv\Scripts\activate     # Windows

# Run tests
uv run pytest tests/

# Or with activated venv
pytest tests/

# Run linting
make lint

# Format code
make format

Using uv

uv automatically manages the virtual environment:

# Run commands without activating venv
uv run pytest tests/
uv run python scripts/quick_start.py

# Or activate venv for interactive use
source .venv/bin/activate

Version Management

Incrementing Build

Build numbers auto-increment:

python scripts/increment_build.py

Updating Changelog

python scripts/update_changelog.py <version> "Description"

Example:

python scripts/update_changelog.py 0.1.1 "Added feature X"

Testing

Running Tests

# All tests
pytest tests/

# Unit tests only
pytest tests/unit/

# Integration tests only
pytest tests/integration/

# With coverage
pytest --cov=ab tests/

Writing Tests

  • Unit tests: Test individual components in isolation
  • Integration tests: Test complete workflows
  • Use fixtures from tests/conftest.py
  • Follow naming: test_<feature>_<scenario>

Code Style

  • Follow PEP 8
  • Use type hints
  • Format with Black (line length 100)
  • Lint with Ruff
  • Type check with mypy

Pull Request Process

  1. Create feature branch
  2. Make changes
  3. Add tests
  4. Update documentation
  5. Run tests and linting
  6. Submit PR

Documentation

  • Update relevant docs in docs/
  • Add examples if introducing new features
  • Update API reference if changing interfaces