From 05fc36b8d6f0a9eaeedd72a9dbbbe899aeeed8e2 Mon Sep 17 00:00:00 2001 From: Jarl Stefansson Date: Tue, 14 Jan 2014 17:02:38 -0500 Subject: Update documentation for python pip --- manifests/pip.pp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/manifests/pip.pp b/manifests/pip.pp index fb73ae7..367cdb3 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: { -- cgit v1.2.3 From 6e9f26a2e0ac360701876cb9cbac09efc2eeab75 Mon Sep 17 00:00:00 2001 From: Jarl Stefansson Date: Thu, 16 Jan 2014 10:32:30 -0500 Subject: Fix pip 1.5/1.4.1 handling --- manifests/virtualenv.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/virtualenv.pp b/manifests/virtualenv.pp index fc540a8..fa2e654 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", -- cgit v1.2.3 From 97793765ee15a93fbde928aaf17397d0c397fa69 Mon Sep 17 00:00:00 2001 From: Jarl Stefansson Date: Mon, 20 Jan 2014 13:49:41 -0500 Subject: Fix syntax error with brace prioritization --- manifests/virtualenv.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/virtualenv.pp b/manifests/virtualenv.pp index fa2e654..8c240ed 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} || ${venv_dir}/bin/pip --log ${venv_dir}/pip.log install ${pypi_index} ${proxy_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", -- cgit v1.2.3