Search code examples
pythondjangodeploymentpaver

Paver Unknown task error


I am getting started with paver and I am not getting a basic command to run, I am not sure what I am missing.

Docs

Link to the documentation

Installation

pip install paver

After installation I am able to execute paver in commandline.

---> paver.tasks.help
Usage: paver [global options] taskname [task options] [taskname [taskoptions]]

Options:
  --version             show program's version number and exit
  -n, --dry-run         don't actually do anything
  -v, --verbose         display all logging output
  -q, --quiet           display only errors
  -i, --interactive     enable prompting
  -f FILE, --file=FILE  read tasks from FILE [pavement.py]
  -h, --help            display this help information
  --propagate-traceback
                        propagate traceback, do not hide it under
                        BuildFailure(for debugging)
  -x COMMAND_PACKAGES, --command-packages=COMMAND_PACKAGES
                        list of packages that provide distutils commands

Tasks from paver.misctasks:
  generate_setup - Generates a setup.py file that uses paver behind the scenes
  minilib        - Create a Paver mini library that contains enough for a simple
    pavement.py to be installed using a generated setup.py
  paverdocs      - Open your web browser and display Paver's documentation.

Tasks from paver.tasks:
  help           - This help display.

paverlib > tasks.py

@task
def testpaver():
    from nose.tools import set_trace;set_trace()

paverlib > _ init _.py

import tasks

Run

paver testpaver
Build failed: Unknown task: testpaver

What I am missing?


Solution

  • By default, Paver looks for pavement.py as a source for task definitions.

    Have you tried putting testpaver in there?