Open hoangelos opened 6 years ago
Hmm, interesting. I have a local html() task in my pavement file that calls the one from paverutils and then does some extra work, so I suppose that's why I don't see that.
As a work-around you could add something like:
@task
def html(options):
"Generate HTML files."
paverutils.html(options)
I'll have to spend some more time to see if there's a better solution than that.
@dhellmann That works, but as you can imagine goes against what we were hoping.
Sure. I don't know if paver has any sort of task dependency/hierarchy resolver that would deal with this case. It's likely to be a while before I have time to do that research, so at least you have a work-around for now.
@hoangelos I realize this is 5 years old, so maybe this explanation doesn't matter anymore...but the issue is that Paver only allows "short names" for tasks if the name is unambiguous.
From the Paver docs:
Tasks that you define in your pavement are always available by their short names. Tasks defined elsewhere are available by their short names unless there is a conflict where two tasks are trying to use the same short name.
So once you import paverutils.doctools
into pavement.py
there's now two tasks with the same name registered, and if you follow the relevant Paver code here it'll try looking for a task defined in the pavement.py
module first, then try importing and finally will try searching through the registry it's tracking through the task
decorator. And that "ambiguous" error message happens when there's two tasks with the same name you're trying to call with paver html
.
I think just adding a line assigning the function to the name html underneath the paverutils
import would fix the error message, like this:
from sphinxcontrib import paverutils
html = paverutils.html
Even more succinct:
from sphinxcontrib.paverutils import html
Hope that helps.
In my pavement file I added
from sphinxcontrib import paverutils
and then when I try to run the html task, it gives me this: