Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin System Tools #3

Open
pedro-psb opened this issue Jun 19, 2023 · 1 comment
Open

Plugin System Tools #3

pedro-psb opened this issue Jun 19, 2023 · 1 comment

Comments

@pedro-psb
Copy link
Member

pedro-psb commented Jun 19, 2023

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
@pedro-psb pedro-psb converted this from a draft issue Jun 19, 2023
@pedro-psb
Copy link
Member Author

I've read pluggy docs and about pytest hooks and I really think we should pick it.
It will streamline the modular architecture we want to build and provide good guidelines for this kind of library organization (mainly, pytest/pluggy docs and pytest codebase).

I don't think we need to reinvent the wheel here, and if for some reason we want/need to drop it, we'll have learned a lot about plugin system patterns.

@pedro-psb pedro-psb moved this from 📋 Draft to 🔖 Backlog in Project Decisions Jun 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🔖 Backlog
Development

No branches or pull requests

1 participant