Virtualenv Support (paver.virtual)

Paver makes it easy to set up virtualenv environments for development and deployment. Virtualenv gives you a place to install Python packages and keep them separate from your main system’s Python installation.

Using virtualenv with tasks

You may specify which virtual environment should particular task use. Do this with @virtualenv decorator:

from paver.easy import task
from paver.virtual import virtualenv

@task
@virtualenv(dir="virtualenv")
def t1():
    import some_module_existing_only_in_virtualenv

paver.virtual Tasks

Tasks for managing virtualenv environments.

paver.virtual.bootstrap()

Creates a virtualenv bootstrap script. The script will create a bootstrap script that populates a virtualenv in the current directory. The environment will have paver, the packages of your choosing and will run the paver command of your choice.

This task looks in the virtualenv options for:

script_name
name of the generated script
packages_to_install
packages to install with pip/easy_install. The version of paver that you are using is included automatically. This should be a list of strings.
paver_command_line
run this paver command line after installation (just the command line arguments, not the paver command itself).
dest_dir
the destination directory for the virtual environment (defaults to ‘.’)
no_site_packages
don’t give access to the global site-packages dir to the virtual environment (default; deprecated)
system_site_packages
give access to the global site-packages dir to the virtual environment
unzip_setuptools
unzip Setuptools when installing it (defaults to False)
distribute
use Distribute instead of Setuptools. Set environment variable VIRTUALENV_DISTRIBUTE to make it the default.
index_url
base URL of Python Package Index
trusted_host
specify whether the given index_url is a trusted host to avoid deprecated warnings
no_index
ignore package index (only looking at find_links URL(s) instead)
find_links
additional URL(s) to search for packages. This should be a list of strings.
prefer_easy_install
prefer easy_install to pip for package installation if both are installed (defaults to False)
paver.virtual.virtualenv(dir)

Run decorated task in specified virtual environment.