summaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
authorNick Groenen <zoni@zoni.nl>2013-03-11 14:28:38 +0100
committerNick Groenen <zoni@zoni.nl>2013-03-11 14:47:30 +0100
commit191376c9c29a7b069ba618a3b59ecad129d4e320 (patch)
tree0d15868076778b72969dac8b9eb56c1767667545 /manifests
parent8fb868d5aa7bbe4d19f83367ba86d4ac4deb6d25 (diff)
Make pip install distribute in a virtualenv optional
pip install distribute currentlyfails on Python 3, this way people can skip installing it. It's included by default to remain backward- compatible
Diffstat (limited to 'manifests')
-rw-r--r--manifests/virtualenv.pp11
1 files changed, 10 insertions, 1 deletions
diff --git a/manifests/virtualenv.pp b/manifests/virtualenv.pp
index e816468..c2595e2 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,
}