[Numpy-svn] r5646 - trunk/tools/osxbuild

numpy-svn@scip... numpy-svn@scip...
Thu Aug 14 00:22:24 CDT 2008


Author: chris.burns
Date: 2008-08-14 00:22:21 -0500 (Thu, 14 Aug 2008)
New Revision: 5646

Added:
   trunk/tools/osxbuild/install_and_test.py
Modified:
   trunk/tools/osxbuild/README.txt
Log:
Add install_and_test script for osxbuild.  Update README.

Modified: trunk/tools/osxbuild/README.txt
===================================================================
--- trunk/tools/osxbuild/README.txt	2008-08-13 22:24:50 UTC (rev 5645)
+++ trunk/tools/osxbuild/README.txt	2008-08-14 05:22:21 UTC (rev 5646)
@@ -1,6 +1,32 @@
-This directory contains the script to build a universal binary for
+==================================
+ Building an OSX binary for numpy
+==================================
+
+This directory contains the scripts to build a universal binary for
 OSX.  The binaries work on OSX 10.4 and 10.5.
 
-  - bdist_mpkg v0.4.3 is required
+The docstring in build.py may contain more current details.
 
-See the docstring in build.py for more details.
+Requirements
+============
+
+* bdist_mpkg v0.4.3
+
+Build
+=====
+
+The build script will build a numpy distribution using bdist_mpkg and
+create the mac package (mpkg) bundled in a disk image (dmg).  To run
+the build script::
+
+  python build.py
+
+Install and test
+----------------
+
+The *install_and_test.py* script will find the numpy*.mpkg, install it
+using the Mac installer and then run the numpy test suite.  To run the
+install and test::
+
+  python install_and_test.py
+

Added: trunk/tools/osxbuild/install_and_test.py
===================================================================
--- trunk/tools/osxbuild/install_and_test.py	2008-08-13 22:24:50 UTC (rev 5645)
+++ trunk/tools/osxbuild/install_and_test.py	2008-08-14 05:22:21 UTC (rev 5646)
@@ -0,0 +1,49 @@
+#!/usr/bin/env python
+"""Install the built package and run the tests."""
+
+import os
+
+# FIXME: Should handle relative import better!
+#from .build import DIST_DIR
+from build import SRC_DIR, DIST_DIR, shellcmd
+
+clrgreen = '\033[0;32m'
+clrnull = '\033[0m'
+# print '\033[0;32m foobar \033[0m'
+def color_print(msg):
+    """Add color to this print output."""
+    clrmsg = clrgreen + msg + clrnull
+    print clrmsg
+    
+distdir = os.path.join(SRC_DIR, DIST_DIR)
+
+# Find the package and build abspath to it
+pkg = None
+filelist = os.listdir(distdir)
+for fn in filelist:
+    if fn.endswith('mpkg'):
+        pkg = fn
+        break
+if pkg is None:
+    raise IOError, 'Package is not found in directory %s' % distdir
+
+pkgpath = os.path.abspath(os.path.join(SRC_DIR, DIST_DIR, pkg))
+color_print('Installing package: %s' % pkgpath)
+
+# Run the installer
+print
+color_print('Installer requires admin rights, you will be prompted for sudo')
+print
+cmd = 'sudo installer -verbose -package %s -target /' % pkgpath
+#color_print(cmd)
+shellcmd(cmd)
+
+# Null out the PYTHONPATH so we're sure to test the Installed version of numpy
+os.environ['PYTHONPATH'] = '0'
+
+print
+color_print('Install successful!')
+color_print('Running numpy test suite!')
+print
+import numpy
+numpy.test()



More information about the Numpy-svn mailing list