pluggy

The minimalist, production-ready plugin and hook system that powers pytest, tox, and devpi

Library
PyPI
v1.6.0
1,682stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
78/100Good
Development Activity96
Maintenance52
Community64
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
84/100Excellent
Architecture88
Code Quality90
Innovation78
Learning Curve80

pluggy is a minimalist plugin and hook-calling framework for Python, extracted from pytest to be reusable by any project that wants a plugin architecture. Projects define a HookspecMarker-decorated hook specification namespace, and plugins implement matching HookimplMarker-decorated hook implementations; a PluginManager registers plugins and dispatches calls to every implementation, collecting their results.

It is the core dependency underlying pytest, tox, and devpi’s plugin systems, and is deliberately small and dependency-free so it can be embedded in any project needing an extensible, third-party-plugin-friendly architecture without adopting a heavier framework.

What You Get

  • A PluginManager for registering, unregistering, and blocking plugins by name
  • HookspecMarker/HookimplMarker decorators to declare hook specifications and implementations under a project-specific namespace
  • Call-time ordering controls (tryfirst, trylast, hookwrapper) for coordinating multiple plugin implementations of the same hook
  • firstresult hooks that stop after the first non-None plugin result, alongside the default all-results-collected behavior
  • A typed, py.typed-marked codebase with historical call tracing support for debugging plugin dispatch

Common Use Cases

  • Building a pytest-style plugin ecosystem where third parties can hook into a tool’s behavior without modifying its core code
  • Adding an extensible plugin architecture to a CLI tool or framework (as tox and devpi do) without pulling in a heavier plugin/DI framework
  • Allowing multiple independently-developed plugins to all respond to the same lifecycle event and aggregating their results
  • Providing library authors a battle-tested, dependency-free hook dispatch mechanism reused across the pytest ecosystem

Under The Hood

Architecture: The package is a small, focused module set under src/pluggy/: _hooks.py defines HookspecMarker, HookimplMarker, and the HookCaller/HookImpl machinery that stores registered implementations per hook name; _manager.py implements PluginManager, which owns the plugin registry and exposes hook.<name>(…) dynamic dispatch; _callers.py implements the actual call loop that invokes each registered implementation in tryfirst/trylast order and aggregates results (or short-circuits for firstresult hooks); _result.py wraps call outcomes/exceptions for hookwrapper implementations; _tracing.py adds optional call tracing for debugging. Tech Stack: Pure Python (99.6%) with zero runtime dependencies, targeting Python 3.10+; built with setuptools plus setuptools-scm for version management, tested with pytest/pytest-benchmark/coverage via tox, and pre-commit for style enforcement. Code Quality: Ships py.typed for full type-checker support, has a mature multi-year test suite (part of the pytest-dev organization’s rigorous CI/release process), and is classified as ‘Development Status :: 6 - Mature’ in its own PyPI metadata, reflecting its role as foundational, heavily-relied-upon infrastructure for the Python testing ecosystem. API Design: The hookspec/hookimpl decorator pattern is deliberately minimal, defining an extension point is a plain method with a decorator, and implementing it in a plugin requires no base-class inheritance, which keeps the boilerplate low, though the dynamic pm.hook.<name>(…) call style trades some static-analysis friendliness for that flexibility.

Used by 11 apps in this directory

Python
90%
Apache 2.0

Apache Airflow

Data Engineering

46,530

Define, schedule, and monitor complex data workflows as Python code — with a powerful UI, 80+ provider integrations, and battle-tested scalability across thousands of production deployments.

View details
96
Repo Health
89
Technical
66
Dependency
Built with
Python90%
Updated today
Python
79%
Apache 2.0

changedetection.io

Monitoring

33,241

Self-hosted website change detection with AI-powered smart alerts, browser automation, price tracking, and 85+ notification channels.

View details
90
Repo Health
80
Technical
69
Dependency
Built with
Python79%
Updated 3 days ago
C++
69%
Apache 2.0

ClickHouse

Databases · Analytics · Data Engineering

49,325

Open-source column-oriented database that delivers real-time analytical queries on petabyte-scale data with millisecond latency.

View details
95
Repo Health
90
Technical
68
Dependency
Built with
C++69%
Python13%
Updated today
C++
74%
Other

Dragonfly

Databases · Developer Tools · Devops

31,013

A modern Redis and Memcached replacement engineered for multi-core servers — delivering 25x more throughput, better cache hit rates, and up to 80% lower memory consumption with full API compatibility.

View details
90
Repo Health
9
Technical
71
Dependency
Built with
C++74%
Python16%
Updated today
TypeScript
91%
Apache 2.0

Helicone

Monitoring · AI Development · Analytics

6,083

An open-source AI gateway and LLM observability platform that routes requests to 100+ models while logging cost, latency, and full traces for every call.

View details
62
Repo Health
81
Technical
66
Dependency
Built with
TypeScript91%
Updated 3 days ago
Python
83%
Apache 2.0

knowhere

AI Development · Developer Tools

2,515

Transform messy, unstructured documents into persistent, navigable memory that AI agents can actually use.

View details
83
Repo Health
75
Technical
70
Dependency
Built with
Python83%
HTML16%
Updated today
TypeScript
55%
Other

Phase Console

Security · Devops

904

End-to-end encrypted secrets management for engineering teams — from local dev to Kubernetes production.

View details
84
Repo Health
73
Technical
67
Dependency
Built with
TypeScript55%
Python44%
Updated today
Python
99%
Apache 2.0

Rasa Open Source

AI Assistants · AI Development

21,295

Rasa Open Source is a Python machine learning framework for building contextual, multi-turn chatbots and voice assistants that understand natural language and maintain conversation state.

View details
67
Repo Health
78
Technical
64
Dependency
Built with
Python99%
Updated 3 weeks ago
Rust
67%
Apache 2.0

Rivet

AI Agents · Developer Tools

6,065

Stateful actors as a primitive for AI agents, real-time collaboration, and durable execution — with in-memory state, WebSockets, queues, and scheduling built in.

View details
86
Repo Health
81
Technical
66
Dependency
Built with
Rust67%
TypeScript29%
Updated today

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search