Designing Plugin Systems for Python Packages

Keynote
Shanghai
1:30 p.m. - 2:10 p.m.
Venue E(Integrated Building, Room 108 Lecture Hall)
  • Ming Xi "Lying-flat" engineer

    Author of the little-known package manager PDM

    mingxi

Abstract

Drawing on real practice from PDM, this talk works through four mainstream plugin patterns to help developers choose the right architecture for their own libraries.

Details

Plugin systems are an underrated design problem in the Python ecosystem. Drawing on real practice from PDM, this talk works through four mainstream patterns: declarative discovery via importlib.metadata entry points; pluggy's hook specifications and call-chain management; the application-factory philosophy behind Flask Blueprints and Django AppConfig; and loosely-coupled communication via signals and events. By comparing the design trade-offs of pytest, Flask, and Django, it helps developers choose the right plugin architecture for their own libraries.