Permalink
Browse files

Add pip support.

  • Loading branch information...
jordansissel committed Nov 30, 2012
1 parent 9eefb0c commit f34017eb20a0a76d22e615597baacbbea20743d2
Showing with 14 additions and 2 deletions.
  1. +14 −2 lib/fpm/package/python.rb
View
@@ -23,6 +23,9 @@ class FPM::Package::Python < FPM::Package
"The path to the python executable you wish to run.", :default => "python"
option "--easyinstall", "EASYINSTALL_EXECUTABLE",
"The path to the easy_install executable tool", :default => "easy_install"
+ option "--pip", "PIP_EXECUTABLE",
+ "The path to the pip executable tool. If not specified, easy_install " \
+ "is used instead", :default => nil
option "--pypi", "PYPI_URL",
"PyPi Server uri for retrieving packages.",
:default => "http://pypi.python.org/simple"
@@ -100,8 +103,17 @@ def download_if_necessary(package, version=nil)
target = build_path(package)
FileUtils.mkdir(target) unless File.directory?(target)
- safesystem(attributes[:python_easyinstall], "-i", attributes[:python_pypi],
- "--editable", "-U", "--build-directory", target, want_pkg)
+ if attributes[:python_pip].nil?
+ # no pip, use easy_install
+ puts "EASY_INSTALL"
+ safesystem(attributes[:python_easyinstall], "-i",
+ attributes[:python_pypi], "--editable", "-U",
+ "--build-directory", target, want_pkg)
+ else
+ puts "PIP PIP CHEERIOS"
+ safesystem(attributes[:python_pip], "install", "--no-install",
+ "-U", "--build", target, want_pkg)
+ end
# easy_install will put stuff in @tmpdir/packagename/, so find that:
# @tmpdir/somepackage/setup.py

0 comments on commit f34017e

Please sign in to comment.