summaryrefslogtreecommitdiff
path: root/tools/osxbuild
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2013-04-06 13:25:26 -0600
committerCharles Harris <charlesr.harris@gmail.com>2013-04-06 13:25:26 -0600
commitbb726ca19f434f5055c0efceefe48d89469fcbbe (patch)
tree889782afaf67fd5acb5f222969251871c0c46e5a /tools/osxbuild
parent7441fa50523f5b4a16c854bf004d675e5bd86ab8 (diff)
downloadnumpy-bb726ca19f434f5055c0efceefe48d89469fcbbe.tar.gz
2to3: Apply `print` fixer.
Add `print_function` to all `from __future__ import ...` statements and use the python3 print function syntax everywhere. Closes #3078.
Diffstat (limited to 'tools/osxbuild')
-rw-r--r--tools/osxbuild/build.py18
-rw-r--r--tools/osxbuild/install_and_test.py12
2 files changed, 15 insertions, 15 deletions
diff --git a/tools/osxbuild/build.py b/tools/osxbuild/build.py
index 7aa9312dd..71d37889d 100644
--- a/tools/osxbuild/build.py
+++ b/tools/osxbuild/build.py
@@ -10,7 +10,7 @@ built using sudo so file permissions are correct when installed on
user system. Script will prompt for sudo pwd.
"""
-from __future__ import division
+from __future__ import division, print_function
import os
import shutil
@@ -26,9 +26,9 @@ BUILD_DIR = 'build'
DIST_DIR = 'dist'
def remove_dirs():
- print 'Removing old build and distribution directories...'
- print """The distribution is built as root, so the files have the correct
- permissions when installed by the user. Chown them to user for removal."""
+ print('Removing old build and distribution directories...')
+ print("""The distribution is built as root, so the files have the correct
+ permissions when installed by the user. Chown them to user for removal.""")
if os.path.exists(BUILD_DIR):
cmd = 'sudo chown -R %s %s' % (getuser(), BUILD_DIR)
shellcmd(cmd)
@@ -39,12 +39,12 @@ def remove_dirs():
shutil.rmtree(DIST_DIR)
def build_dist():
- print 'Building distribution... (using sudo)'
+ print('Building distribution... (using sudo)')
cmd = 'sudo python setupegg.py bdist_mpkg'
shellcmd(cmd)
def build_dmg():
- print 'Building disk image...'
+ print('Building disk image...')
# Since we removed the dist directory at the start of the script,
# our pkg should be the only file there.
pkg = os.listdir(DIST_DIR)[0]
@@ -60,19 +60,19 @@ def copy_readme():
"""Copy a user README with info regarding the website, instead of
the developer README which tells one how to build the source.
"""
- print 'Copy user README.txt for installer.'
+ print('Copy user README.txt for installer.')
shutil.copy(USER_README, DEV_README)
def revert_readme():
"""Revert the developer README."""
- print 'Reverting README.txt...'
+ print('Reverting README.txt...')
cmd = 'svn revert %s' % DEV_README
shellcmd(cmd)
def shellcmd(cmd, verbose=True):
"""Call a shell command."""
if verbose:
- print cmd
+ print(cmd)
try:
subprocess.check_call(cmd, shell=True)
except subprocess.CalledProcessError as err:
diff --git a/tools/osxbuild/install_and_test.py b/tools/osxbuild/install_and_test.py
index 651298b3f..0243724d9 100644
--- a/tools/osxbuild/install_and_test.py
+++ b/tools/osxbuild/install_and_test.py
@@ -2,7 +2,7 @@
"""Install the built package and run the tests.
"""
-from __future__ import division
+from __future__ import division, print_function
import os
@@ -16,7 +16,7 @@ clrnull = '\033[0m'
def color_print(msg):
"""Add color to this print output."""
clrmsg = clrgreen + msg + clrnull
- print clrmsg
+ print(clrmsg)
distdir = os.path.join(SRC_DIR, DIST_DIR)
@@ -34,9 +34,9 @@ pkgpath = os.path.abspath(os.path.join(SRC_DIR, DIST_DIR, pkg))
color_print('Installing package: %s' % pkgpath)
# Run the installer
-print
+print()
color_print('Installer requires admin rights, you will be prompted for sudo')
-print
+print()
cmd = 'sudo installer -verbose -package %s -target /' % pkgpath
#color_print(cmd)
shellcmd(cmd)
@@ -44,9 +44,9 @@ shellcmd(cmd)
# Null out the PYTHONPATH so we're sure to test the Installed version of numpy
os.environ['PYTHONPATH'] = '0'
-print
+print()
color_print('Install successful!')
color_print('Running numpy test suite!')
-print
+print()
import numpy
numpy.test()