nat-n / poethepoet

A task runner that works well with poetry.

Home Page:https://poethepoet.natn.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Proposal: support third party extensions

nat-n opened this issue · comments

Poe the Poet is already quite modular by design, and easy to extend with new task or executor types. However I can imagine that there may be use cases for kinds of tasks or ways of executing them that I wouldn’t relate to so easily or wouldn’t know enough about the context. For example defining tasks in terms of plumbum scripts, or executing them in an environment managed with nix.

To support this poe could be made to support specifying a plugin as a python module referenced by a global config option (e.g. tool.poe.plugins = ["poethepoet_contrib_pipenv.executor"]). Providing such a config would cause poe to load the specified module on every run, with the expectation that the module will define and register PoeExecutor/PoeTask classes that may then be used by tasks defined in the same file.

One caveat is that the python module containing the plugin would have to be available from the same environment as poe itself, and so not have any dependencies that require activating a different virtual environment for instance.