|
33 | 33 | pip_binary="/usr/local/bin/pip"
|
34 | 34 | end
|
35 | 35 |
|
36 |
| -# Ubuntu's python-setuptools, python-pip and python-virtualenv packages |
37 |
| -# are broken...this feels like Rubygems! |
38 |
| -# http://stackoverflow.com/questions/4324558/whats-the-proper-way-to-install-pip-virtualenv-and-distribute-for-python |
39 |
| -# https://bitbucket.org/ianb/pip/issue/104/pip-uninstall-on-ubuntu-linux |
40 |
| -remote_file"#{Chef::Config[:file_cache_path]}/distribute_setup.py"do |
41 |
| -sourcenode['python']['distribute_script_url'] |
| 36 | +remote_file"#{Chef::Config[:file_cache_path]}/ez_setup.py"do |
| 37 | +sourcenode['python']['setuptools_script_url'] |
| 38 | +mode"0644" |
| 39 | +not_if"#{node['python']['binary']} -c 'import setuptools'" |
| 40 | +end |
| 41 | + |
| 42 | +remote_file"#{Chef::Config[:file_cache_path]}/get-pip.py"do |
| 43 | +sourcenode['python']['pip_script_url'] |
42 | 44 | mode"0644"
|
43 | 45 | not_if{ ::File.exists?(pip_binary)}
|
44 | 46 | end
|
45 | 47 |
|
| 48 | +execute"install-setuptools"do |
| 49 | +cwdChef::Config[:file_cache_path] |
| 50 | +command<<-EOF |
| 51 | +#{node['python']['binary']} ez_setup.py |
| 52 | + EOF |
| 53 | +not_if"#{node['python']['binary']} -c 'import setuptools'" |
| 54 | +end |
| 55 | + |
46 | 56 | execute"install-pip"do
|
47 | 57 | cwdChef::Config[:file_cache_path]
|
48 | 58 | command<<-EOF
|
49 |
| -#{node['python']['binary']} distribute_setup.py --download-base=#{node['python']['distribute_option']['download_base']} |
50 |
| -#{::File.dirname(pip_binary)}/easy_install pip |
| 59 | +#{node['python']['binary']} get-pip.py |
51 | 60 | EOF
|
52 | 61 | not_if{ ::File.exists?(pip_binary)}
|
53 | 62 | end
|