Skip to content

Latest commit

 

History

History
109 lines (79 loc) · 2.49 KB

DEVELOPMENT.md

File metadata and controls

109 lines (79 loc) · 2.49 KB

Development

Guide for contributing to Apte.

Prerequisites

  • Python 3.10+
  • uv - Package manager
  • just - Command runner

Setup

git clone https://github.com/renaudcepre/apte.git
cd apte
just setup

This installs dependencies and sets up pre-commit hooks.

Commands

just              # Show available commands
just test         # Run tests
just test-cov     # Run tests with coverage
just lint         # Format and lint code
just fullcheck    # Lint + types + tests (CI equivalent)
just docs         # Serve documentation locally
just clean        # Remove cache files

Running Tests

Apte uses pytest for its own test suite:

# All tests
just test

# Specific file
just test tests/core/test_session.py

# With coverage
just test-cov

# Coverage with HTML report
just test-cov-open

Code Quality

Linting & Formatting

just lint

Uses:

  • ruff format - Code formatting
  • ruff check - Linting (pyflakes, pycodestyle, bugbear, etc.)
  • mypy --strict - Type checking

Pre-commit

Pre-commit hooks run automatically on git commit. To run manually:

pre-commit run --all-files

Project Structure

apte/
├── apte/              # Main package
│   ├── cli/              # Command-line interface
│   ├── core/             # Session, suite, runner, collector
│   ├── di/               # Dependency injection (Use, From, ForEach)
│   ├── entities/         # Data classes (TestResult, etc.)
│   ├── events/           # Event bus and hooks
│   ├── execution/        # Test execution engine
│   ├── filters/          # Test filtering (keywords, suites)
│   ├── fixtures/         # Built-in fixtures (caplog, mocker)
│   ├── reporting/        # Reporters (Rich, ASCII, CTRF, Web)
│   ├── tags/             # Tag filtering plugin
│   └── cache/            # Last-failed cache plugin
├── tests/                # Test suite (mirrors apte/ structure)
├── docs/                 # MkDocs documentation
├── web/                  # Web reporter UI (Vite + vanilla JS)
└── examples/             # Example project (yorkshire)

Documentation

just docs

Opens http://127.0.0.1:8000 with live reload.

Documentation source is in docs/ using MkDocs with Material theme.

Running the Example

uv run apte run examples.yorkshire.tests.session:session