diff options
author | Sergey Stankevich <sergey@stankevi.ch> | 2013-03-14 04:44:10 -0700 |
---|---|---|
committer | Sergey Stankevich <sergey@stankevi.ch> | 2013-03-14 04:44:10 -0700 |
commit | 7abfab94312888cdbafd67a955677048e081a2c3 (patch) | |
tree | e0480625a589dc537f9f7f9952b49dd26ee80321 /manifests | |
parent | 34f562aa3ea82462022e9d3ab625ab63b3237fa4 (diff) | |
parent | 191376c9c29a7b069ba618a3b59ecad129d4e320 (diff) |
Merge pull request #5 from zoni/distribute
Make pip install distribute in a virtualenv optional
Diffstat (limited to 'manifests')
-rw-r--r-- | manifests/virtualenv.pp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/manifests/virtualenv.pp b/manifests/virtualenv.pp index b56da85..ace2a00 100644 --- a/manifests/virtualenv.pp +++ b/manifests/virtualenv.pp @@ -19,6 +19,9 @@ # [*systempkgs*] # Copy system site-packages into virtualenv. Default: don't # +# [*distribute*] +# Include distribute in the virtualenv. Default: true +# # === Examples # # python::virtualenv { '/var/www/project1': @@ -41,6 +44,7 @@ define python::virtualenv ( $requirements = false, $proxy = false, $systempkgs = false, + $distribute = true, ) { $venv_dir = $name @@ -67,11 +71,16 @@ define python::virtualenv ( default => '--system-site-packages', } + $distribute_pkg = $distribute ? { + true => 'distribute', + default => '', + } + exec { "python_virtualenv_${venv_dir}": command => "mkdir -p ${venv_dir} \ ${proxy_command} \ && virtualenv -p `which ${python}` ${system_pkgs_flag} ${venv_dir} \ - && ${venv_dir}/bin/pip install ${proxy_flag} --upgrade distribute pip", + && ${venv_dir}/bin/pip install ${proxy_flag} --upgrade ${distribute_pkg} pip", creates => $venv_dir, } |