Skip to main content

Some additional functions for working with remote virtualenvs in Fabric.

Project description

fabric-virtualenv provides Fabric functions for creating virtualenvs on remote servers, as well as installing packages to them, and running other Fabric operations in the context of the virtualenv.

fabvenv.virtualenv(path)

A context manager that performs all nested operations in the context of the virtualenv path.

For example:

>>> from fabvenv import virtualenv
>>> with virtualenv('/home/me/venv/'):
...     run('python foo')

It is highly recommended to use an absolute path, as Fabric’s cd() contextmanager is always applied BEFORE virtualenv(), regardless of how they are nested.

fabvenv.make_virtualenv(path, dependencies=[], eggs=[], system_site_packages=True)

Create or update a virtualenv in path, installing the given packages and eggs.

  • path - The path to the virtualenv. This path will be created if it

    does not already exist.

  • dependencies - a list of paths or URLs to Python packages to install

    with pip.

  • eggs - a list of paths or URLs to eggs to install with

    easy_install. Eggs can be used to speed up deployments that require libraries to be compiled.

  • system_site_packages - If True, the newly-created virtualenv will

    expose the system site package. If False, these will be hidden. Note that this only takes effect on a newly-created virtualenv.

fabvenv.prepare_virtualenv()

Ensure a version of the virtualenv command is available on the remote server. If none exists, a standalone virtualenv.py script will be downloaded from the virtualenv github and saved as ~/virtualenv.py.

The virtualenv command that is prepared is available as env.virtualenv.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fabric-virtualenv-0.1.1.tar.gz (2.9 kB view details)

Uploaded Source

File details

Details for the file fabric-virtualenv-0.1.1.tar.gz.

File metadata

File hashes

Hashes for fabric-virtualenv-0.1.1.tar.gz
Algorithm Hash digest
SHA256 9ff208eb984769a84c1e6bdf9b4e71dfe1ecec7ccdaba13d4c172d49c45377cc
MD5 7908fe68fd78b399e057a6cce9ac0873
BLAKE2b-256 c6e97fad5d5650b6de386aecba665f5a52c8c881c44cbd9defed075b38a8e058

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page