diff options
author | Jarl Stefansson <jarl@sdelements.com> | 2014-01-02 11:36:39 -0500 |
---|---|---|
committer | Jarl Stefansson <jarl@sdelements.com> | 2014-01-02 11:36:39 -0500 |
commit | ae04aad7b8fd5f88f6bc379dbabd21000dcb9a85 (patch) | |
tree | 412c9a0f147915cdd7e40c08231595bb3e357c15 /manifests | |
parent | 0b4438b64eb2f24f9aff75116cbefb3fc85b5241 (diff) |
Add flag to disable wheels for python 2.6
Setuptools 0.8 is required for pip wheel support, Python 2.6 and older only
support setuptools 0.7, we therefor need to disable wheels.
Diffstat (limited to 'manifests')
-rw-r--r-- | manifests/virtualenv.pp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/manifests/virtualenv.pp b/manifests/virtualenv.pp index f74cc4f..3a7997e 100644 --- a/manifests/virtualenv.pp +++ b/manifests/virtualenv.pp @@ -98,7 +98,7 @@ define python::virtualenv ( default => "&& export http_proxy=${proxy}", } - # Virtualenv versions prior to 1.7 do not support the + # Virtualenv versions prior to 1.7 do not support the # --system-site-packages flag, default off for prior versions # Prior to version 1.7 the default was equal to --system-site-packages # and the flag --no-site-packages had to be passed to do the opposite @@ -110,6 +110,14 @@ define python::virtualenv ( $system_pkgs_flag = '' } + # Python 2.6 and older don't support setuptools > 0.8 which is required + # for pip wheel support, it therefor requires --no-use-wheel flag + if ( versioncmp($::python_version,'2.6') > 0 ) { + $wheel_support_flag = '--no-use-wheel' + } else { + $wheel_support_flag = '' + } + $distribute_pkg = $distribute ? { true => 'distribute', default => '', @@ -120,7 +128,7 @@ define python::virtualenv ( } 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} --upgrade pip ${distribute_pkg}", + 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}", user => $owner, path => $path, cwd => "/tmp", @@ -130,7 +138,7 @@ define python::virtualenv ( if $requirements { exec { "python_requirements_initial_install_${requirements}_${venv_dir}": - command => "${venv_dir}/bin/pip --log ${venv_dir}/pip.log install ${pypi_index} ${proxy_flag} -r ${requirements}", + command => "${venv_dir}/bin/pip --log ${venv_dir}/pip.log install ${pypi_index} ${proxy_flag} ${wheel_support_flag} -r ${requirements}", refreshonly => true, timeout => $timeout, user => $owner, |