PageRenderTime 53ms CodeModel.GetById 1ms RepoModel.GetById 1ms app.codeStats 0ms

/python/recipes/pip.rb

https://bitbucket.org/cavneb/cookbooks
Ruby | 38 lines | 13 code | 2 blank | 23 comment | 0 complexity | d1b9e2c0b2a3c73c47afdc8bc572a8c1 MD5 | raw file
  1. #
  2. # Author:: Seth Chisamore <schisamo@opscode.com>
  3. # Cookbook Name:: python
  4. # Recipe:: pip
  5. #
  6. # Copyright 2011, Opscode, Inc.
  7. #
  8. # Licensed under the Apache License, Version 2.0 (the "License");
  9. # you may not use this file except in compliance with the License.
  10. # You may obtain a copy of the License at
  11. #
  12. # http://www.apache.org/licenses/LICENSE-2.0
  13. #
  14. # Unless required by applicable law or agreed to in writing, software
  15. # distributed under the License is distributed on an "AS IS" BASIS,
  16. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  17. # See the License for the specific language governing permissions and
  18. # limitations under the License.
  19. #
  20. # Ubuntu's python-setuptools, python-pip and python-virtualenv packages
  21. # are broken...this feels like Rubygems!
  22. # http://stackoverflow.com/questions/4324558/whats-the-proper-way-to-install-pip-virtualenv-and-distribute-for-python
  23. # https://bitbucket.org/ianb/pip/issue/104/pip-uninstall-on-ubuntu-linux
  24. remote_file "#{Chef::Config[:file_cache_path]}/distribute_setup.py" do
  25. source "http://python-distribute.org/distribute_setup.py"
  26. mode "0644"
  27. not_if "which pip"
  28. end
  29. bash "install-pip" do
  30. cwd Chef::Config[:file_cache_path]
  31. code <<-EOF
  32. python distribute_setup.py
  33. easy_install pip
  34. EOF
  35. not_if "which pip"
  36. end