Instead of searching through tasks.py which might be picked up from PATH, I think it would be better to move this/prioritize static definitions in invoke.yaml (also should search for .invoke.yaml) and equivalents at an object /tasks or /invoke. The configuration could be to point to file/module to load and search ns and @task from as currently done. Or better yet, point to the specific Collection object that defines these in a format equivalent to entry_points.console_scripts.
This will make it easy to define executables in non-installed python projects, e.g. jupyter notebooks.
Instead of searching through
tasks.py
which might be picked up fromPATH
, I think it would be better to move this/prioritize static definitions ininvoke.yaml
(also should search for.invoke.yaml
) and equivalents at an object/tasks
or/invoke
. The configuration could be to point to file/module to load and searchns
and@task
from as currently done. Or better yet, point to the specificCollection
object that defines these in a format equivalent toentry_points.console_scripts
.This will make it easy to define executables in non-installed python projects, e.g. jupyter notebooks.