|  | 
|  | 1 | +# CLAUDE.md | 
|  | 2 | + | 
|  | 3 | +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. | 
|  | 4 | + | 
|  | 5 | +## Project Overview | 
|  | 6 | + | 
|  | 7 | +Pluggy is a minimalist production-ready plugin system that serves as the core framework for pytest, datasette and devpi. | 
|  | 8 | +It provides hook specification and implementation mechanisms through a plugin manager system. | 
|  | 9 | + | 
|  | 10 | +## Development Commands | 
|  | 11 | + | 
|  | 12 | +All commands use `uv run` for consistent environments. | 
|  | 13 | + | 
|  | 14 | +### Testing | 
|  | 15 | +- `uv run pytest` - Run all tests (prefer running all tests for quick feedback) | 
|  | 16 | +- `uv run pytest testing/benchmark.py` - Run benchmark tests | 
|  | 17 | + | 
|  | 18 | +### Code Quality | 
|  | 19 | +- `uv run pre-commit run -a` - Run all pre-commit hooks (linting, formatting, type checking) | 
|  | 20 | +- Always reread files modified by pre-commit | 
|  | 21 | + | 
|  | 22 | +## Development Process | 
|  | 23 | + | 
|  | 24 | +- Always read `src/pluggy/*.py` to get a full picture | 
|  | 25 | +- Consider backward compatibility | 
|  | 26 | +- Always run all tests: `uv run pytest` | 
|  | 27 | +- Always run pre-commit before committing: `uv run pre-commit run -a` | 
|  | 28 | +- Prefer running full pre-commit over individual tools (ruff/mypy) | 
|  | 29 | + | 
|  | 30 | + | 
|  | 31 | + | 
|  | 32 | +## Core Architecture | 
|  | 33 | + | 
|  | 34 | +### Main Components | 
|  | 35 | + | 
|  | 36 | +- **PluginManager** (`src/pluggy/_manager.py`): Central registry that manages plugins and coordinates hook calls | 
|  | 37 | +- **HookCaller** (`src/pluggy/_hooks.py`): Executes hook implementations with proper argument binding | 
|  | 38 | +- **HookImpl/HookSpec** (`src/pluggy/_hooks.py`): Represent hook implementations and specifications | 
|  | 39 | +- **Result** (`src/pluggy/_result.py`): Handles hook call results and exception propagation | 
|  | 40 | +- **Multicall** (`src/pluggy/_callers.py`): Core execution engine for calling multiple hook implementations | 
|  | 41 | + | 
|  | 42 | +### Package Structure | 
|  | 43 | +- `src/pluggy/` - Main package source | 
|  | 44 | +- `testing/` - Test suite using pytest | 
|  | 45 | +- `docs/` - Sphinx documentation and examples | 
|  | 46 | +- `changelog/` - Towncrier fragments for changelog generation | 
|  | 47 | + | 
|  | 48 | +## Configuration Files | 
|  | 49 | +- `pyproject.toml` - Project metadata, build system, tool configuration (ruff, mypy, setuptools-scm) | 
|  | 50 | +- `tox.ini` - Multi-environment testing configuration | 
|  | 51 | +- `.pre-commit-config.yaml` - Code quality automation (ruff, mypy, flake8, etc.) | 
0 commit comments