Fernando Perez | 36d3c16 | 2006-07-12 06:02:28 | [diff] [blame] | 1 | #!/usr/bin/env python |
Travis Oliphant | c8b5a7e | 2006-01-06 02:12:50 | [diff] [blame] | 2 | """NumPy: array processing for numbers, strings, records, and objects. |
Travis Oliphant | da9c6da | 2006-01-04 17:31:07 | [diff] [blame] | 3 | |
Travis Oliphant | c8b5a7e | 2006-01-06 02:12:50 | [diff] [blame] | 4 | NumPy is a general-purpose array-processing package designed to |
Travis Oliphant | da9c6da | 2006-01-04 17:31:07 | [diff] [blame] | 5 | efficiently manipulate large multi-dimensional arrays of arbitrary |
| 6 | records without sacrificing too much speed for small multi-dimensional |
Travis Oliphant | c8b5a7e | 2006-01-06 02:12:50 | [diff] [blame] | 7 | arrays. NumPy is built on the Numeric code base and adds features |
Travis Oliphant | da9c6da | 2006-01-04 17:31:07 | [diff] [blame] | 8 | introduced by numarray as well as an extended C-API and the ability to |
Travis Oliphant | 00a3587 | 2007-05-31 04:57:01 | [diff] [blame] | 9 | create arrays of arbitrary type which also makes NumPy suitable for |
| 10 | interfacing with general-purpose data-base applications. |
Travis Oliphant | da9c6da | 2006-01-04 17:31:07 | [diff] [blame] | 11 | |
| 12 | There are also basic facilities for discrete fourier transform, |
| 13 | basic linear algebra and random number generation. |
| 14 | """ |
| 15 | |
| 16 | DOCLINES = __doc__.split("\n") |
Pearu Peterson | c415fd1 | 2002-11-18 22:39:31 | [diff] [blame] | 17 | |
Fernando Perez | 083ca64 | 2007-12-30 03:04:17 | [diff] [blame] | 18 | import __builtin__ |
Pearu Peterson | e8fa013 | 2003-03-07 18:08:28 | [diff] [blame] | 19 | import os |
| 20 | import sys |
Pearu Peterson | c415fd1 | 2002-11-18 22:39:31 | [diff] [blame] | 21 | |
Travis Oliphant | da9c6da | 2006-01-04 17:31:07 | [diff] [blame] | 22 | CLASSIFIERS = """\ |
Robert Kern | 28042b4 | 2008-06-18 22:55:30 | [diff] [blame] | 23 | Development Status :: 5 - Production/Stable |
Travis Oliphant | da9c6da | 2006-01-04 17:31:07 | [diff] [blame] | 24 | Intended Audience :: Science/Research |
| 25 | Intended Audience :: Developers |
| 26 | License :: OSI Approved |
| 27 | Programming Language :: C |
| 28 | Programming Language :: Python |
| 29 | Topic :: Software Development |
| 30 | Topic :: Scientific/Engineering |
| 31 | Operating System :: Microsoft :: Windows |
| 32 | Operating System :: POSIX |
| 33 | Operating System :: Unix |
| 34 | Operating System :: MacOS |
| 35 | """ |
| 36 | |
Fernando Perez | 36d3c16 | 2006-07-12 06:02:28 | [diff] [blame] | 37 | # BEFORE importing distutils, remove MANIFEST. distutils doesn't properly |
| 38 | # update it when the contents of directories change. |
| 39 | if os.path.exists('MANIFEST'): os.remove('MANIFEST') |
| 40 | |
Fernando Perez | 083ca64 | 2007-12-30 03:04:17 | [diff] [blame] | 41 | # This is a bit hackish: we are setting a global variable so that the main |
| 42 | # numpy __init__ can detect if it is being loaded by the setup routine, to |
| 43 | # avoid attempting to load components that aren't built yet. While ugly, it's |
| 44 | # a lot more robust than what was previously being used. |
| 45 | __builtin__.__NUMPY_SETUP__ = True |
| 46 | |
Pearu Peterson | 471196b | 2006-03-31 08:59:36 | [diff] [blame] | 47 | def configuration(parent_package='',top_path=None): |
| 48 | from numpy.distutils.misc_util import Configuration |
| 49 | |
Pearu Peterson | 17d7cfe | 2006-04-04 12:26:14 | [diff] [blame] | 50 | config = Configuration(None, parent_package, top_path) |
Pearu Peterson | 471196b | 2006-03-31 08:59:36 | [diff] [blame] | 51 | config.set_options(ignore_setup_xxx_py=True, |
| 52 | assume_default_configuration=True, |
| 53 | delegate_options_to_subpackages=True, |
| 54 | quiet=True) |
Jarrod Millman | 0b77f0e | 2007-10-29 14:58:18 | [diff] [blame] | 55 | |
Pearu Peterson | 471196b | 2006-03-31 08:59:36 | [diff] [blame] | 56 | config.add_subpackage('numpy') |
Jarrod Millman | 0b77f0e | 2007-10-29 14:58:18 | [diff] [blame] | 57 | |
Pearu Peterson | 7b76ca7 | 2007-06-05 18:54:28 | [diff] [blame] | 58 | config.add_data_files(('numpy','*.txt'), |
| 59 | ('numpy','COMPATIBILITY'), |
Pearu Peterson | 7b76ca7 | 2007-06-05 18:54:28 | [diff] [blame] | 60 | ('numpy','site.cfg.example')) |
Pearu Peterson | 17d7cfe | 2006-04-04 12:26:14 | [diff] [blame] | 61 | |
| 62 | config.get_version('numpy/version.py') # sets config.version |
Travis Oliphant | 00a3587 | 2007-05-31 04:57:01 | [diff] [blame] | 63 | |
Pearu Peterson | 471196b | 2006-03-31 08:59:36 | [diff] [blame] | 64 | return config |
| 65 | |
Pearu Peterson | e8fa013 | 2003-03-07 18:08:28 | [diff] [blame] | 66 | def setup_package(): |
Travis Oliphant | 14db419 | 2005-09-14 22:08:46 | [diff] [blame] | 67 | |
Travis Oliphant | da9c6da | 2006-01-04 17:31:07 | [diff] [blame] | 68 | from numpy.distutils.core import setup |
Travis Oliphant | 14db419 | 2005-09-14 22:08:46 | [diff] [blame] | 69 | |
Pearu Peterson | e8fa013 | 2003-03-07 18:08:28 | [diff] [blame] | 70 | old_path = os.getcwd() |
Pearu Peterson | d190674 | 2003-11-24 22:50:40 | [diff] [blame] | 71 | local_path = os.path.dirname(os.path.abspath(sys.argv[0])) |
| 72 | os.chdir(local_path) |
Travis Oliphant | 14db419 | 2005-09-14 22:08:46 | [diff] [blame] | 73 | sys.path.insert(0,local_path) |
Pearu Peterson | e8fa013 | 2003-03-07 18:08:28 | [diff] [blame] | 74 | |
| 75 | try: |
Pearu Peterson | 17d7cfe | 2006-04-04 12:26:14 | [diff] [blame] | 76 | setup( |
| 77 | name = 'numpy', |
Pearu Peterson | 17d7cfe | 2006-04-04 12:26:14 | [diff] [blame] | 78 | maintainer = "NumPy Developers", |
| 79 | maintainer_email = "numpy-discussion@lists.sourceforge.net", |
| 80 | description = DOCLINES[0], |
| 81 | long_description = "\n".join(DOCLINES[2:]), |
Robert Kern | 28042b4 | 2008-06-18 22:55:30 | [diff] [blame] | 82 | url = "http://numpy.scipy.org", |
cookedm | 2276bf7 | 2006-04-21 16:15:12 | [diff] [blame] | 83 | download_url = "http://sourceforge.net/project/showfiles.php?group_id=1369&package_id=175103", |
Pearu Peterson | 17d7cfe | 2006-04-04 12:26:14 | [diff] [blame] | 84 | license = 'BSD', |
| 85 | classifiers=filter(None, CLASSIFIERS.split('\n')), |
| 86 | author = "Travis E. Oliphant, et.al.", |
| 87 | author_email = "oliphant@ee.byu.edu", |
Jarrod Millman | 0b77f0e | 2007-10-29 14:58:18 | [diff] [blame] | 88 | platforms = ["Windows", "Linux", "Solaris", "Mac OS-X", "Unix"], |
Pearu Peterson | 17d7cfe | 2006-04-04 12:26:14 | [diff] [blame] | 89 | configuration=configuration ) |
Pearu Peterson | e8fa013 | 2003-03-07 18:08:28 | [diff] [blame] | 90 | finally: |
| 91 | del sys.path[0] |
| 92 | os.chdir(old_path) |
Travis Oliphant | 14db419 | 2005-09-14 22:08:46 | [diff] [blame] | 93 | return |
Pearu Peterson | c415fd1 | 2002-11-18 22:39:31 | [diff] [blame] | 94 | |
Travis Oliphant | 14db419 | 2005-09-14 22:08:46 | [diff] [blame] | 95 | if __name__ == '__main__': |
Pearu Peterson | e8fa013 | 2003-03-07 18:08:28 | [diff] [blame] | 96 | setup_package() |