summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Stankevich <stankevich@users.noreply.github.com>2014-01-27 11:27:15 -0800
committerSergey Stankevich <stankevich@users.noreply.github.com>2014-01-27 11:27:15 -0800
commit9c48fb3c0df9ff8044fe384efb8c97cf85b5d72c (patch)
tree7a3e08edf9e475846ebd486f363e5961d20712e0
parent28c08f47ec6fce17f9f3e80385ed7e517fb1661b (diff)
parent0671d69354bb4ddd65159a516dc38c32b05c5e05 (diff)
Merge pull request #57 from jalli/master
Fix pip wheel handling when wheels are supported but --no-use-wheel flag is not
-rw-r--r--manifests/pip.pp18
-rw-r--r--manifests/virtualenv.pp2
2 files changed, 14 insertions, 6 deletions
diff --git a/manifests/pip.pp b/manifests/pip.pp
index 4aacb31..4f91e59 100644
--- a/manifests/pip.pp
+++ b/manifests/pip.pp
@@ -85,12 +85,20 @@ define python::pip (
default => "${url}#egg=${egg_name}",
}
- # 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
+ # We need to jump through hoops to make sure we issue the correct pip command
+ # depending on wheel support and versions.
+ #
+ # Pip does not support wheels prior to version 1.4.0
+ # Pip wheels require setuptools/distribute > 0.8
+ # Python 2.6 and older does not support setuptools/distribute > 0.8
+ # Pip >= 1.5 tries to use wheels by default, even if wheel package is not
+ # installed, in this case the --no-use-wheel flag needs to be passed
+ # Versions prior to 1.5 don't support the --no-use-wheel flag
+ #
# 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
+ # version, this makes sure we only use wheels if they are supported and
+ # installed
+
case $ensure {
present: {
diff --git a/manifests/virtualenv.pp b/manifests/virtualenv.pp
index a7a2bcb..b9cd689 100644
--- a/manifests/virtualenv.pp
+++ b/manifests/virtualenv.pp
@@ -127,7 +127,7 @@ define python::virtualenv (
# 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 wheel --help > /dev/null 2>&1 && { ${venv_dir}/bin/pip wheel --version > /dev/null 2>&1 || 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}",
+ command => "mkdir -p ${venv_dir} ${proxy_command} && virtualenv ${system_pkgs_flag} -p ${python} ${venv_dir} && ${venv_dir}/bin/pip wheel --help > /dev/null 2>&1 && { ${venv_dir}/bin/pip wheel --version > /dev/null 2>&1 || 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} || ${venv_dir}/bin/pip --log ${venv_dir}/pip.log install ${pypi_index} ${proxy_flag} --upgrade pip ${distribute_pkg} ;}",
user => $owner,
path => $path,
cwd => "/tmp",