diff options
author | chris.burns <chris.burns@localhost> | 2008-08-14 05:22:21 +0000 |
---|---|---|
committer | chris.burns <chris.burns@localhost> | 2008-08-14 05:22:21 +0000 |
commit | c30bb0a07c2b17f36fdaabe906859dd51f9cb0f6 (patch) | |
tree | a04f78fa5281e79eaaadc42ab0ff8116911859ba /tools | |
parent | dcb2e6c797532d8b122a6f010aefd861fbccb2e1 (diff) | |
download | numpy-c30bb0a07c2b17f36fdaabe906859dd51f9cb0f6.tar.gz |
Add install_and_test script for osxbuild. Update README.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/osxbuild/README.txt | 32 | ||||
-rw-r--r-- | tools/osxbuild/install_and_test.py | 49 |
2 files changed, 78 insertions, 3 deletions
diff --git a/tools/osxbuild/README.txt b/tools/osxbuild/README.txt index 9de0d740d..00600f190 100644 --- a/tools/osxbuild/README.txt +++ b/tools/osxbuild/README.txt @@ -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. + +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 -See the docstring in build.py for more details. diff --git a/tools/osxbuild/install_and_test.py b/tools/osxbuild/install_and_test.py new file mode 100644 index 000000000..f03e5bd7c --- /dev/null +++ b/tools/osxbuild/install_and_test.py @@ -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() |