Paver Build and Deployment Scripting
Paver is a Python-based build and task management system, designed to simplify scripting for development, distribution, and deployment. Its last stable release, 1.3.4, was in 2017. The project appears to be unmaintained and is not recommended for new development.
Common errors
-
ImportError: No module named paver
cause The Paver library is not installed in the current Python environment.fixRun `pip install paver` to install the library. -
NameError: name 'task' is not defined
cause The '@task' decorator (and other Paver utilities) were not correctly imported.fixEnsure `from paver.easy import *` is present at the top of your `pavement.py` file. -
No such task: <task_name>
cause The task specified on the command line does not exist or is misspelled in the `pavement.py` file.fixDouble-check the task name provided to `paver <task_name>` against the `@task` definitions in `pavement.py`. Ensure the task function is correctly decorated.
Warnings
- breaking The Paver project is no longer actively maintained. Its last release was in 2017, and there have been no significant updates since. Using it for new projects is strongly discouraged.
- gotcha While Paver 1.3.4 aims for Python 3 compatibility, complex setups, especially those relying on older `distutils` or `setuptools` integrations, may encounter unexpected behavior or errors on newer Python 3 versions.
- gotcha Paver's dependency management for tasks, using `@needs`, defines a strict ordering. Misunderstanding how dependencies are resolved can lead to tasks not running in the expected sequence or skipped entirely.
Install
-
pip install paver
Imports
- *
from paver.easy import *
Quickstart
from paver.easy import *
@task
def hello():
print("Hello from Paver!")
@task
@needs('hello')
def world():
print("World! This task depends on 'hello'.")
# To run:
# Save this as 'pavement.py'
# Then execute in terminal: 'paver hello' or 'paver world'