ReleaseEngineering/PuppetAgain/Modules/python: Difference between revisions

no edit summary
(Created page with "This module handles installing Python virtualenvs containing Python packages. See ReleaseEngineering/How To/Install a Python Virtualenv with Puppet for a tutorial reference ...")
 
No edit summary
Line 1: Line 1:
This module handles installing Python virtualenvs containing Python packages.  See [[ReleaseEngineering/How To/Install a Python Virtualenv with Puppet]] for a tutorial reference to using the module.
This module handles installing Python virtualenvs containing Python packages.  See [[ReleaseEngineering/How To/Install a Python Virtualenv with Puppet]] for a tutorial reference to using the module.
= Usage =
The main interface used here is <tt>python::virtualenv</tt>.  It takes the following parameters:
;title: The virtualenv directory to create
;python: The python to use to build the virtualenv (mandatory)
;ensure: present (default) or absent
;packages: array of packages to include, in the format ''pkgname==version''.  Include all required packages - dependencies are not followed.  Running ''pip freeze'' in a test virtualenv can help determine this list (mandatory)
;user: user that should own the virtualenv (default root/admin)
;group: group that should own the virtualenv (default root)
Note that the python, user, and group attributes only have an effect when the virtualenv is created.  Packages can be added to the packages list, or their versions changed, but removing a package from the list will not result in puppet removing it from the virtualenv.


= Example =
= Example =
Line 21: Line 32:


An appropriate package file for the system must be available in the [[ReleaseEngineering/PuppetAgain/Python|python package directory]].  For pure-python packages, this can be an sdist tarball or zip; for packages that include some compiled source (e.g., Twisted), things can get a bit more complicated - see [[ReleaseEngineering/PuppetAgain/Python|here]] for more details.
An appropriate package file for the system must be available in the [[ReleaseEngineering/PuppetAgain/Python|python package directory]].  For pure-python packages, this can be an sdist tarball or zip; for packages that include some compiled source (e.g., Twisted), things can get a bit more complicated - see [[ReleaseEngineering/PuppetAgain/Python|here]] for more details.
It is up to the caller to ensure that Python is installed before the virtualenv is created.
canmove, Confirmed users
1,394

edits