Task Handling (paver.tasks)

paver.tasks is the main part of Paver. In fact, it can even be used on its own to provide Paver’s task-running capabilities.

exception paver.tasks.BuildFailure
Represents a problem with some part of the build’s execution.
exception paver.tasks.PavementError
Exception that represents a problem in the pavement.py file rather than the process of running a build.
paver.tasks.cmdopts(options)

Sets the command line options that can be set for this task. This uses the same format as the distutils command line option parser. It’s a list of tuples, each with three elements: long option name, short option, description.

If the long option name ends with ‘=’, that means that the option takes a value. Otherwise the option is just boolean. All of the options will be stored in the options dict with the name of the task. Each value that gets stored in that dict will be stored with a key that is based on the long option name (the only difference is that - is replaced by _).

paver.tasks.consume_args(func)
Any command line arguments that appear after this task on the command line will be placed in options.args.
paver.tasks.help(args, help_function)
This help display.
paver.tasks.needs(*args)

Specifies tasks upon which this task depends.

req can be a string or a list of strings with the names of the tasks. You can call this decorator multiple times and the various requirements are added on. You can also call with the requirements as a list of arguments.

The requirements are called in the order presented in the list.

paver.tasks.no_auto(func)
Specify that this task does not depend on the auto task, and don’t run the auto task just for this one.
paver.tasks.task(func)

Specifies that this function is a task.

Note that this decorator does not actually replace the function object. It just keeps track of the task and sets an is_task flag on the function object.

Previous topic

The Paver Standard Library

Next topic

distutils and setuptools (paver.setuputils)

This Page