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 createlib/python/invenio/
and symlink it the virtualenv’s site-packages, as well asvar/tmp/ooffice-tmp-files
(via sudo). Ifenv.WITH_DEVSCRIPTS
isTrue
, invenio-devscripts will be installed. Ifenv.WITH_WORKDIR
isTrue
git-new-workdir will be installed.Lastly, it will append render the template
activate-profile.tpl
and append it tobin/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 taskinveniofab.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 taskinveniofab.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
andunohelper.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.