File tree Expand file tree Collapse file tree 2 files changed +19
-10
lines changed
Expand file tree Collapse file tree 2 files changed +19
-10
lines changed Original file line number Diff line number Diff line change 3838default [ 'python' ] [ 'checksum' ] = '3b477554864e616a041ee4d7cef9849751770bc7c39adaf78a94ea145c488059'
3939default [ 'python' ] [ 'configure_options' ] = %W{ --prefix=#{ python [ 'prefix_dir' ] } }
4040
41- default [ 'python' ] [ 'distribute_script_url ' ] = 'http ://python-distribute .org/distribute_setup .py'
42- default [ 'python' ] [ 'distribute_option' ] [ 'download_base' ] = 'https://pypi.python.org/packages/source/d/distribute/ '
41+ default [ 'python' ] [ 'setuptools_script_url ' ] = 'https ://bitbucket .org/pypa/setuptools/raw/0.8/ez_setup .py'
42+ default [ 'python' ] [ 'pip_script_url' ] = 'https://raw.github.com/pypa/pip/master/contrib/get-pip.py '
Original file line number Diff line number Diff line change 3333pip_binary = "/usr/local/bin/pip"
3434end
3535
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- source node [ 'python' ] [ 'distribute_script_url' ]
36+ remote_file "#{ Chef ::Config [ :file_cache_path ] } /ez_setup.py" do
37+ source node [ '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+ source node [ 'python' ] [ 'pip_script_url' ]
4244mode "0644"
4345not_if { ::File . exists? ( pip_binary ) }
4446end
4547
48+ execute "install-setuptools" do
49+ cwd Chef ::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+
4656execute "install-pip" do
4757cwd Chef ::Config [ :file_cache_path ]
4858command <<-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
5160 EOF
5261not_if { ::File . exists? ( pip_binary ) }
5362end
You can’t perform that action at this time.
0 commit comments