aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/python3.rb
diff options
context:
space:
mode:
authorTim D. Smith2014-12-23 00:01:44 -0500
committerTim D. Smith2014-12-31 17:53:07 -0800
commiteb46358a0c455a1f0666b8c2c366fde5ce4ec252 (patch)
tree6fbd8e0195a1ac3b62fd44cba5150c1dffc65511 /Library/Formula/python3.rb
parentab84675e2e24d8135daadea9e0e41d228aeeb7a8 (diff)
downloadhomebrew-eb46358a0c455a1f0666b8c2c366fde5ce4ec252.tar.bz2
python3: don't use ensurepip
Diffstat (limited to 'Library/Formula/python3.rb')
-rw-r--r--Library/Formula/python3.rb31
1 files changed, 29 insertions, 2 deletions
diff --git a/Library/Formula/python3.rb b/Library/Formula/python3.rb
index a9e273fdb..bf784002a 100644
--- a/Library/Formula/python3.rb
+++ b/Library/Formula/python3.rb
@@ -33,6 +33,16 @@ class Python3 < Formula
skip_clean "bin/pip3", "bin/pip-#{VER}"
skip_clean "bin/easy_install3", "bin/easy_install-#{VER}"
+ resource "setuptools" do
+ url "https://pypi.python.org/packages/source/s/setuptools/setuptools-8.2.1.tar.gz"
+ sha1 "ddb4454303142be3446437e4fafb13bbd4570133"
+ end
+
+ resource "pip" do
+ url "https://pypi.python.org/packages/source/p/pip/pip-6.0.3.tar.gz"
+ sha1 "67d4affd83ee2f3514ac1386bee59f10f672517c"
+ end
+
patch :DATA if build.with? "brewed-tk"
def site_packages_cellar
@@ -128,6 +138,10 @@ class Python3 < Formula
# Remove the site-packages that Python created in its Cellar.
site_packages_cellar.rmtree
+
+ %w[setuptools pip].each do |r|
+ (libexec/r).install resource(r)
+ end
end
def post_install
@@ -152,8 +166,20 @@ class Python3 < Formula
rm_rf Dir["#{site_packages}/setuptools*"]
rm_rf Dir["#{site_packages}/distribute*"]
- # Install the bundled pip if it's newer than the installed version
- system bin/"python3", "-m", "ensurepip", "--upgrade"
+ %w[setuptools pip].each do |pkg|
+ (libexec/pkg).cd do
+ system bin/"python3", "-s", "setup.py", "--no-user-cfg", "install",
+ "--force", "--verbose", "--install-scripts=#{bin}",
+ "--install-lib=#{site_packages}"
+ end
+ end
+
+ rm_rf [bin/"pip", bin/"easy_install"]
+
+ # post_install happens after link
+ %W[pip3 pip#{VER} easy_install-#{VER}].each do |e|
+ (HOMEBREW_PREFIX/"bin").install_symlink bin/e
+ end
# And now we write the distutils.cfg
cfg = prefix/"Frameworks/Python.framework/Versions/#{VER}/lib/python#{VER}/distutils/distutils.cfg"
@@ -272,6 +298,7 @@ class Python3 < Formula
system "#{bin}/python#{VER}", "-c", "import sqlite3"
# Check if some other modules import. Then the linked libs are working.
system "#{bin}/python#{VER}", "-c", "import tkinter; root = tkinter.Tk()"
+ system bin/"pip3", "list"
end
end