aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/python3.rb
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Formula/python3.rb')
-rw-r--r--Library/Formula/python3.rb33
1 files changed, 20 insertions, 13 deletions
diff --git a/Library/Formula/python3.rb b/Library/Formula/python3.rb
index 22ba55411..21bb51051 100644
--- a/Library/Formula/python3.rb
+++ b/Library/Formula/python3.rb
@@ -11,9 +11,12 @@ class Python3 < Formula
sha1 "a27901327dad9d61f50be6e2dbde59116da682e2" => :mountain_lion
end
- VER="3.4" # The <major>.<minor> is used so often.
+ head "https://hg.python.org/cpython", :using => :hg, :branch => "3.5"
- head "https://hg.python.org/cpython", :using => :hg, :branch => VER
+ devel do
+ url "https://www.python.org/ftp/python/3.5.0/Python-3.5.0a1.tgz"
+ sha1 "e9441525f37d65623f5efab0b7ca726ab52b1fb9"
+ end
option :universal
option "quicktest", "Run `make quicktest` after the build"
@@ -28,8 +31,8 @@ class Python3 < Formula
depends_on "homebrew/dupes/tcl-tk" if build.with? "brewed-tk"
depends_on :x11 if build.with? "brewed-tk" and Tab.for_name("tcl-tk").with? "x11"
- skip_clean "bin/pip3", "bin/pip-#{VER}"
- skip_clean "bin/easy_install3", "bin/easy_install-#{VER}"
+ skip_clean "bin/pip3", "bin/pip-3.4", "bin/pip-3.5"
+ skip_clean "bin/easy_install3", "bin/easy_install-3.4", "bin/easy_install-3.5"
resource "setuptools" do
url "https://pypi.python.org/packages/source/s/setuptools/setuptools-12.0.5.tar.gz"
@@ -44,12 +47,12 @@ class Python3 < Formula
patch :DATA if build.with? "brewed-tk"
def site_packages_cellar
- prefix/"Frameworks/Python.framework/Versions/#{VER}/lib/python#{VER}/site-packages"
+ prefix/"Frameworks/Python.framework/Versions/#{xy}/lib/python#{xy}/site-packages"
end
# The HOMEBREW_PREFIX location of site-packages.
def site_packages
- HOMEBREW_PREFIX/"lib/python#{VER}/site-packages"
+ HOMEBREW_PREFIX/"lib/python#{xy}/site-packages"
end
fails_with :llvm do
@@ -146,7 +149,7 @@ class Python3 < Formula
# Fix up the site-packages so that user-installed Python software survives
# minor updates, such as going from 3.3.2 to 3.3.3:
- # Create a site-packages in HOMEBREW_PREFIX/lib/python#{VER}/site-packages
+ # Create a site-packages in HOMEBREW_PREFIX/lib/python#{xy}/site-packages
site_packages.mkpath
# Symlink the prefix site-packages into the cellar.
@@ -175,12 +178,12 @@ class Python3 < Formula
rm_rf [bin/"pip", bin/"easy_install"]
# post_install happens after link
- %W[pip3 pip#{VER} easy_install-#{VER}].each do |e|
+ %W[pip3 pip#{xy} easy_install-#{xy}].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"
+ cfg = prefix/"Frameworks/Python.framework/Versions/#{xy}/lib/python#{xy}/distutils/distutils.cfg"
cfg.atomic_write <<-EOF.undent
[global]
verbose=1
@@ -189,6 +192,10 @@ class Python3 < Formula
EOF
end
+ def xy
+ version.to_s.slice /(3.\d)/
+ end
+
def distutils_fix_superenv(args)
# To allow certain Python bindings to find brewed software (and sqlite):
sqlite = Formula["sqlite"].opt_prefix
@@ -234,7 +241,7 @@ class Python3 < Formula
' You should `unset PYTHONPATH` to fix this.')
else:
# Only do this for a brewed python:
- opt_executable = '#{opt_bin}/python#{VER}'
+ opt_executable = '#{opt_bin}/python#{xy}'
if os.path.realpath(sys.executable) == os.path.realpath(opt_executable):
# Remove /System site-packages, and the Cellar site-packages
# which we moved to lib/pythonX.Y/site-packages. Further, remove
@@ -251,7 +258,7 @@ class Python3 < Formula
# Assume Framework style build (default since months in brew)
try:
from _sysconfigdata import build_time_vars
- build_time_vars['LINKFORSHARED'] = '-u _PyMac_Error #{opt_prefix}/Frameworks/Python.framework/Versions/#{VER}/Python'
+ build_time_vars['LINKFORSHARED'] = '-u _PyMac_Error #{opt_prefix}/Frameworks/Python.framework/Versions/#{xy}/Python'
except:
pass # remember: don't print here. Better to fail silently.
@@ -293,9 +300,9 @@ class Python3 < Formula
test do
# Check if sqlite is ok, because we build with --enable-loadable-sqlite-extensions
# and it can occur that building sqlite silently fails if OSX's sqlite is used.
- system "#{bin}/python#{VER}", "-c", "import sqlite3"
+ system "#{bin}/python#{xy}", "-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}/python#{xy}", "-c", "import tkinter; root = tkinter.Tk()"
system bin/"pip3", "list"
end
end