Skip to content

Plugin System Tools #3

@pedro-psb

Description

@pedro-psb

Context and Problem Statement

The new project requires a plugin system to keep the core minimal.

What tools should we use to build a plugin system?

Decision Drivers

Open

Considered Options

  • pluggy
  • from scratch

Pros and Cons of the Options

Pluggy

Pluggy is the plugin library used by pytest, which is maybe the most well known plugin system in the python ecosystem.

about pluggy | pytest hooks examples

[Good]
- mature framework used by really big project in python ecosystem
- lighweight dependecy (it has a small codebase, no more than 1500 lines)
- seems easy and flexible to setup and use
 
[Bad]
- maybe it can limit some decisions?

From Scratch

Python entrypoints system can be used to build a plugin system alongside importlib.

entrypoints specifications | setuptools userguide on entrypoints

[Good]
- the system will be tailored to the library needs
 
[Bad]
- more error and bug prone
- more work to get it up and running

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    🔖 Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions