summaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
authorJarl Stefansson <jarl@sdelements.com>2014-01-02 15:56:38 -0500
committerJarl Stefansson <jarl@sdelements.com>2014-01-02 15:56:38 -0500
commit10633ecbde7bd269e0e02d1ae5ba5313bc00c24b (patch)
tree15c93ea1d9537aa6f8d0b3717bb2a5e85eae296e /manifests
parent784a8bca85023490169bf9663740419caea776a0 (diff)
Fix handling of wheel support for initial pip
Diffstat (limited to 'manifests')
-rw-r--r--manifests/pip.pp6
-rw-r--r--manifests/virtualenv.pp18
2 files changed, 11 insertions, 13 deletions
diff --git a/manifests/pip.pp b/manifests/pip.pp
index 6c0425e..5849ca9 100644
--- a/manifests/pip.pp
+++ b/manifests/pip.pp
@@ -86,9 +86,9 @@ define python::pip (
default => "${url}#egg=${egg_name}",
}
- # Python 2.6 and older don't support setuptools/distribute > 0.8 which is required
- # for pip wheel support, pip therefor requires --no-use-wheel flag if the
- # pip version is more recent thatn 1.4.1 but using an old python or
+ # Python 2.6 and older does not support setuptools/distribute > 0.8 which
+ # is required for pip wheel support, pip therefor requires --no-use-wheel flag
+ # if the # pip version is more recent than 1.4.1 but using an old python or
# setuputils/distribute version
# To check for this we test for wheel parameter using help and then using
# version, this makes sure we only use wheels if they are supported
diff --git a/manifests/virtualenv.pp b/manifests/virtualenv.pp
index 3e61e1f..94bbd15 100644
--- a/manifests/virtualenv.pp
+++ b/manifests/virtualenv.pp
@@ -110,15 +110,6 @@ define python::virtualenv (
$system_pkgs_flag = ''
}
- # Python 2.6 and older don't support setuptools/distribute > 0.8 which is required
- # for pip wheel support, pip therefor requires --no-use-wheel flag if the
- # version is newer than 1.4.1 when they added wheels
- if (( versioncmp($::python_version,'2.6') > 0 ) and ( versioncmp($::pip_version,'1.4.1') > 0)) {
- $wheel_support_flag = '--no-use-wheel'
- } else {
- $wheel_support_flag = ''
- }
-
$distribute_pkg = $distribute ? {
true => 'distribute',
default => '',
@@ -128,8 +119,15 @@ define python::virtualenv (
default => "-i ${index}",
}
+ # Python 2.6 and older does not support setuptools/distribute > 0.8 which
+ # is required for pip wheel support, pip therefor requires --no-use-wheel flag
+ # if the # pip version is more recent than 1.4.1 but using an old python or
+ # setuputils/distribute version
+ # To check for this we test for wheel parameter using help and then using
+ # version, this makes sure we only use wheels if they are supported
+
exec { "python_virtualenv_${venv_dir}":
- command => "mkdir -p ${venv_dir} ${proxy_command} && virtualenv ${system_pkgs_flag} -p ${python} ${venv_dir} && ${venv_dir}/bin/pip --log ${venv_dir}/pip.log install ${pypi_index} ${proxy_flag} ${wheel_support_flag} --upgrade pip ${distribute_pkg}",
+ command => "mkdir -p ${venv_dir} ${proxy_command} && virtualenv ${system_pkgs_flag} -p ${python} ${venv_dir} && ${venv_dir}/bin/pip $pip_env wheel --help && ${venv_dir}/bin/pip wheel --version || wheel_support_flag='--no-use-wheel'; ${venv_dir}/bin/pip --log ${venv_dir}/pip.log install ${pypi_index} ${proxy_flag} \$wheel_support_flag --upgrade pip ${distribute_pkg}",
user => $owner,
path => $path,
cwd => "/tmp",