|
162 | 162 | default => "${url}#egg=${egg_name}", |
163 | 163 | } |
164 | 164 |
|
165 | | - # We need to jump through hoops to make sure we issue the correct pip command |
166 | | - # depending on wheel support and versions. |
167 | | - # |
168 | | - # Pip does not support wheels prior to version 1.4.0 |
169 | | - # Pip wheels require setuptools/distribute > 0.8 |
170 | | - # Python 2.6 and older does not support setuptools/distribute > 0.8 |
171 | | - # Pip >= 1.5 tries to use wheels by default, even if wheel package is not |
172 | | - # installed, in this case the --no-use-wheel flag needs to be passed |
173 | | - # Versions prior to 1.5 don't support the --no-use-wheel flag |
174 | | - # |
175 | | - # To check for this we test for wheel parameter using help and then using |
176 | | - # show, this makes sure we only use wheels if they are supported and |
177 | | - # installed |
178 | | - $wheel_check = "${pip_env} wheel --help > /dev/null 2>&1 && { ${pip_env} show wheel > /dev/null 2>&1 || wheel_support_flag='--no-binary :all:'; }" |
179 | | - |
180 | 165 | $pip_install = "${pip_env} --log ${log}/pip.log install" |
181 | 166 | $pip_common_args = "${pypi_index} ${proxy_flag} ${install_args} ${install_editable} ${source}" |
182 | 167 |
|
183 | 168 | # Explicit version out of VCS when PIP supported URL is provided |
184 | 169 | if $source =~ /^(git\+|hg\+|bzr\+|svn\+)(http|https|ssh|svn|sftp|ftp|lp)(:\/\/).+$/ { |
185 | 170 | if $ensure != present and $ensure != latest { |
186 | 171 | exec { "pip_install_${name}": |
187 | | - command => "${wheel_check} ; { ${pip_install} ${install_args} \$wheel_support_flag ${pip_common_args}@${ensure}#egg=${egg_name} || ${pip_install} ${install_args} ${pip_common_args}@${ensure}#egg=${egg_name} ;}", |
| 172 | + command => "${pip_install} ${install_args} ${pip_common_args}@${ensure}#egg=${egg_name}", |
188 | 173 | unless => "${pip_env} freeze --all | grep -i -e ${grep_regex}", |
189 | 174 | user => $owner, |
190 | 175 | group => $group, |
|
196 | 181 | } |
197 | 182 | } else { |
198 | 183 | exec { "pip_install_${name}": |
199 | | - command => "${wheel_check} ; { ${pip_install} ${install_args} \$wheel_support_flag ${pip_common_args} || ${pip_install} ${install_args} ${pip_common_args} ;}", |
| 184 | + command => "${pip_install} ${install_args} ${pip_common_args}", |
200 | 185 | unless => "${pip_env} freeze --all | grep -i -e ${grep_regex}", |
201 | 186 | user => $owner, |
202 | 187 | group => $group, |
|
213 | 198 | # Version formats as per http://guide.python-distribute.org/specification.html#standard-versioning-schemes |
214 | 199 | # Explicit version. |
215 | 200 | exec { "pip_install_${name}": |
216 | | - command => "${wheel_check} ; { ${pip_install} ${install_args} \$wheel_support_flag ${pip_common_args}==${ensure} || ${pip_install} ${install_args} ${pip_common_args}==${ensure} ;}", |
| 201 | + command => "${pip_install} ${install_args} ${pip_common_args}==${ensure}", |
217 | 202 | unless => "${pip_env} freeze --all | grep -i -e ${grep_regex} || ${pip_env} list | sed -e 's/[ ]\\+/==/' -e 's/[()]//g' | grep -i -e ${grep_regex}", |
218 | 203 | user => $owner, |
219 | 204 | group => $group, |
|
228 | 213 | 'present': { |
229 | 214 | # Whatever version is available. |
230 | 215 | exec { "pip_install_${name}": |
231 | | - command => "${wheel_check} ; { ${pip_install} \$wheel_support_flag ${pip_common_args} || ${pip_install} ${pip_common_args} ;}", |
| 216 | + command => "${pip_install} ${pip_common_args}", |
232 | 217 | unless => "${pip_env} freeze --all | grep -i -e ${grep_regex} || ${pip_env} list | sed -e 's/[ ]\\+/==/' -e 's/[()]//g' | grep -i -e ${grep_regex}", |
233 | 218 | user => $owner, |
234 | 219 | group => $group, |
|
259 | 244 |
|
260 | 245 | # Latest version. |
261 | 246 | exec { "pip_install_${name}": |
262 | | - command => "${wheel_check} ; { ${pip_install} --upgrade \$wheel_support_flag ${pip_common_args} || ${pip_install} --upgrade ${pip_common_args} ;}", |
| 247 | + command => "${pip_install} --upgrade ${pip_common_args}", |
263 | 248 | unless => $unless_command, |
264 | 249 | user => $owner, |
265 | 250 | group => $group, |
|
0 commit comments