Re: Implementing a plug-in mechanism

2023-03-16 Thread Loris Bennett
Simon Ward writes: > On Thu, Mar 16, 2023 at 07:45:18AM +1300, dn via Python-list wrote: >> There is a PyPi library called pluggy (not used it). I've used >> informal approaches using an ABC as a framework/reminder (see >> @George's response). > > typing.Protocol is also useful here as the plugin

Re: Implementing a plug-in mechanism

2023-03-16 Thread Simon Ward
On Thu, Mar 16, 2023 at 07:45:18AM +1300, dn via Python-list wrote: There is a PyPi library called pluggy (not used it). I've used informal approaches using an ABC as a framework/reminder (see @George's response). typing.Protocol is also useful here as the plugin interface can be defined sepa

Re: Implementing a plug-in mechanism

2023-03-15 Thread Thomas Passin
On 3/15/2023 6:06 PM, Weatherby,Gerard wrote: I do something similar to Thomas. (Also MIT licensed). I like objects. I like type hints. Each plugin needs to have check and purpose functions and accepts either PluginSpec (by default) or AddonSpec if it defines addon = True I omitted the check

Re: Implementing a plug-in mechanism

2023-03-15 Thread Weatherby,Gerard
I do something similar to Thomas. (Also MIT licensed). I like objects. I like type hints. Each plugin needs to have check and purpose functions and accepts either PluginSpec (by default) or AddonSpec if it defines addon = True This requires a single-level plugin directory with no extra files in

Re: Implementing a plug-in mechanism

2023-03-15 Thread Thomas Passin
On 3/15/2023 2:45 PM, dn via Python-list wrote: On 16/03/2023 01.47, Loris Bennett wrote: I have written a program which, as part of the non-core functionality, contains a module to generate email.  This is currently very specific to my organisation, so the main program contains    import myorg

Re: Implementing a plug-in mechanism

2023-03-15 Thread dn via Python-list
On 16/03/2023 01.47, Loris Bennett wrote: I have written a program which, as part of the non-core functionality, contains a module to generate email. This is currently very specific to my organisation, so the main program contains import myorg.mailer This module is specific to my organisati

Re: Implementing a plug-in mechanism

2023-03-15 Thread Weatherby,Gerard
: Wednesday, March 15, 2023 at 1:03 PM To: python-list@python.org Subject: Implementing a plug-in mechanism *** Attention: This is an external email. Use caution responding, opening attachments or clicking on links. *** Hi, I have written a program which, as part of the non-core functionality

Implementing a plug-in mechanism

2023-03-15 Thread Loris Bennett
Hi, I have written a program which, as part of the non-core functionality, contains a module to generate email. This is currently very specific to my organisation, so the main program contains import myorg.mailer This module is specific to my organisation in that it can ask an internal serv