Virtualenv

Tasks for creating and installing Python virtual environments.

All task works on local system.

inveniofab.venv.venv_create

Create virtualenv environment

The virtualenv is created in env.CFG_INVENIO_PREFIX, and will also create lib/python/invenio/ and symlink it the virtualenv’s site-packages, as well as var/tmp/ooffice-tmp-files (via sudo). If env.WITH_DEVSCRIPTS is True, invenio-devscripts will be installed. If env.WITH_WORKDIR is True git-new-workdir will be installed.

Lastly, it will append render the template activate-profile.tpl and append it to bin/activate. The script will setup common needed environment variables that e.g. invenio-devscripts depend on.

If an existing environment already exists, the user will be asked for confirmation to remove the directory (using sudo, due to the directory var/tmp/ooffice-tmp-files which is created using sudo).

inveniofab.venv.venv_drop

Drop virtualenv environment

inveniofab.venv.venv_load

Load an archived virtualenv

The task will extract an archived virtual environment created with venv_dump(). Normally this command is invoked indirectly via the compound task inveniofab.compound.load() which takes care of loading the database after extracting the virtual environment.

inveniofab.venv.venv_dump

Archive a virtualenv

The task will create an archive <virtualenv name>.tar.gz of the entire virtual environment. If an existing archive already exists, the user will be asked for confirmation to remove it. Normally this command is invoked indirectly via the compound task inveniofab.compound.dump() which takes care of dumping the database prior to archiving the virtual environment.

inveniofab.venv.venv_requirements

Install Python packages

The task will install Python packages defined in PIP requirements file.

inveniofab.venv.venv_pyuno_install

Install Python OpenOffice binding

The tassk will try to locate uno.py and unohelper.py in /usr/, and copy it to your virtualenv’s site-packages.

Warning

The Python OpenOffice bindings from your system is specific to your system’s Python interpreter, hence if your system Python is 2.7 and you are installing the bindings into virtualenv with Python 2.4, the bindings will not work.