Join GitHub today
Task module discovery goes on an unexpected journey #131
The behavior invoke currently has for task module discovery: http://invoke.readthedocs.org/en/0.6.1/concepts/loading.html#task-module-discovery is counter to what I expect.
I have my project with many dependencies, with a tasks.py with invoke tasks in it. I type
Invoke discovers the tasks in
What actually happens
Invoke walks through my python path and finds a random tasks module in a random package and tries to run it instead and ends up waking a dragon. In another project with an older version of invoke, I know finds a tasks.py for celery.
I would expect the tasks module discovery to find the same module that
referenced this issue
Apr 14, 2014
For some reasoning on the hybrid FS and sys.path approach, see #92 (comment) . Additionally, specific to your issue (which could otherwise be solved by ignoring
The real problem here, though, is that the feature is insufficiently thorough and doesn't ensure your local task module is first in the path in all situations, which leads to the scenario you described.
For example, we ran into the same thing just now here at Pycon sprints, with Invoke itself:
The good news is we just fixed this by always unconditionally putting the local task.py's containing directory first in