Build plugins using Pluggy
Kracekumar Ramaraju (~kracekumar) |
As a programmer, we build applications all the time. The application design needs to be scalable, manageable, testable, and extensible. The plugins are one of the ways to make the application components extensible.
The dynamic nature of Python and packaging tools allows the host program to register the thrid-party plugins and run the plugins during the life-cycle of the program.
Pytest plugins are developed using pluggy. Pluggy is a powerful framework for developing the plugin architecture.
This talk will provide an introduction to pluggy framework, concepts, and show how to build an application using pluggy.
- Introduction and working of the Plugin system
- Explaining Pluggy library
- What is the specification with an example?
- What is the implementation with an example?
- How to register the plugin?
- Running the plugin system hook with an example
- Do's and Don't's with pluggy
- Testing the plugin system
- What is the plugin system?
- Why one should consider using plugin architecture?
- How to use pluggy to build a plugin system?
Links in the description
- Pluggy - https://pluggy.readthedocs.io/en/latest/
- Pytest - https://docs.pytest.org/en/latest/
- Setup tools entry point - https://setuptools.readthedocs.io/en/latest/setuptools.html#dynamic-discovery-of-services-and-plugins
- Familiarity with Python
- An understanding of how Python setup.py works - https://setuptools.readthedocs.io/en/latest/setuptools.html#dynamic-discovery-of-services-and-plugins
I'm Kracekumar and been using Python for a long time for fun, social causes, and profit. I work as a data engineer.
Python introduced Type Hints a few years ago, I gave a talk about using Python Type hints at work in PySangamam Conference in Chennai - Python Type hints Talk Video.