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 |
| 9 | create arrays of arbitrary type. |
| 10 | |
| 11 | There are also basic facilities for discrete fourier transform, |
| 12 | basic linear algebra and random number generation. |
| 13 | """ |
| 14 | |
| 15 | DOCLINES = __doc__.split("\n") |
Pearu Peterson | c415fd1 | 2002-11-18 22:39:31 | [diff] [blame] | 16 | |
Pearu Peterson | e8fa013 | 2003-03-07 18:08:28 | [diff] [blame] | 17 | import os |
| 18 | import sys |
Pearu Peterson | c415fd1 | 2002-11-18 22:39:31 | [diff] [blame] | 19 | |
Travis Oliphant | da9c6da | 2006-01-04 17:31:07 | [diff] [blame] | 20 | CLASSIFIERS = """\ |
| 21 | Development Status :: 4 - Beta |
| 22 | Intended Audience :: Science/Research |
| 23 | Intended Audience :: Developers |
| 24 | License :: OSI Approved |
| 25 | Programming Language :: C |
| 26 | Programming Language :: Python |
| 27 | Topic :: Software Development |
| 28 | Topic :: Scientific/Engineering |
| 29 | Operating System :: Microsoft :: Windows |
| 30 | Operating System :: POSIX |
| 31 | Operating System :: Unix |
| 32 | Operating System :: MacOS |
| 33 | """ |
| 34 | |
Fernando Perez | 36d3c16 | 2006-07-12 06:02:28 | [diff] [blame] | 35 | # BEFORE importing distutils, remove MANIFEST. distutils doesn't properly |
| 36 | # update it when the contents of directories change. |
| 37 | if os.path.exists('MANIFEST'): os.remove('MANIFEST') |
| 38 | |
Pearu Peterson | 471196b | 2006-03-31 08:59:36 | [diff] [blame] | 39 | def configuration(parent_package='',top_path=None): |
| 40 | from numpy.distutils.misc_util import Configuration |
| 41 | |
Pearu Peterson | 17d7cfe | 2006-04-04 12:26:14 | [diff] [blame] | 42 | config = Configuration(None, parent_package, top_path) |
Pearu Peterson | 471196b | 2006-03-31 08:59:36 | [diff] [blame] | 43 | config.set_options(ignore_setup_xxx_py=True, |
| 44 | assume_default_configuration=True, |
| 45 | delegate_options_to_subpackages=True, |
| 46 | quiet=True) |
| 47 | |
| 48 | config.add_subpackage('numpy') |
Pearu Peterson | 17d7cfe | 2006-04-04 12:26:14 | [diff] [blame] | 49 | |
Pearu Peterson | 471196b | 2006-03-31 08:59:36 | [diff] [blame] | 50 | config.add_data_files(('numpy',['*.txt','COMPATIBILITY', |
| 51 | 'scipy_compatibility'])) |
Pearu Peterson | 17d7cfe | 2006-04-04 12:26:14 | [diff] [blame] | 52 | |
| 53 | config.get_version('numpy/version.py') # sets config.version |
Pearu Peterson | 471196b | 2006-03-31 08:59:36 | [diff] [blame] | 54 | |
| 55 | return config |
| 56 | |
Pearu Peterson | e8fa013 | 2003-03-07 18:08:28 | [diff] [blame] | 57 | def setup_package(): |
Travis Oliphant | 14db419 | 2005-09-14 22:08:46 | [diff] [blame] | 58 | |
Travis Oliphant | da9c6da | 2006-01-04 17:31:07 | [diff] [blame] | 59 | from numpy.distutils.core import setup |
Travis Oliphant | 14db419 | 2005-09-14 22:08:46 | [diff] [blame] | 60 | |
Pearu Peterson | e8fa013 | 2003-03-07 18:08:28 | [diff] [blame] | 61 | old_path = os.getcwd() |
Pearu Peterson | d190674 | 2003-11-24 22:50:40 | [diff] [blame] | 62 | local_path = os.path.dirname(os.path.abspath(sys.argv[0])) |
| 63 | os.chdir(local_path) |
Travis Oliphant | 14db419 | 2005-09-14 22:08:46 | [diff] [blame] | 64 | sys.path.insert(0,local_path) |
Pearu Peterson | e8fa013 | 2003-03-07 18:08:28 | [diff] [blame] | 65 | |
| 66 | try: |
Pearu Peterson | 17d7cfe | 2006-04-04 12:26:14 | [diff] [blame] | 67 | from numpy.version import version |
| 68 | setup( |
| 69 | name = 'numpy', |
| 70 | version = version, # will be overwritten by configuration version |
| 71 | maintainer = "NumPy Developers", |
| 72 | maintainer_email = "numpy-discussion@lists.sourceforge.net", |
| 73 | description = DOCLINES[0], |
| 74 | long_description = "\n".join(DOCLINES[2:]), |
| 75 | url = "http://numeric.scipy.org", |
cookedm | 2276bf7 | 2006-04-21 16:15:12 | [diff] [blame] | 76 | 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] | 77 | license = 'BSD', |
| 78 | classifiers=filter(None, CLASSIFIERS.split('\n')), |
| 79 | author = "Travis E. Oliphant, et.al.", |
| 80 | author_email = "oliphant@ee.byu.edu", |
| 81 | platforms = ["Windows", "Linux", "Solaris", "Mac OS-X", "Unix"], |
| 82 | configuration=configuration ) |
Pearu Peterson | e8fa013 | 2003-03-07 18:08:28 | [diff] [blame] | 83 | finally: |
| 84 | del sys.path[0] |
| 85 | os.chdir(old_path) |
Travis Oliphant | 14db419 | 2005-09-14 22:08:46 | [diff] [blame] | 86 | return |
Pearu Peterson | c415fd1 | 2002-11-18 22:39:31 | [diff] [blame] | 87 | |
Travis Oliphant | 14db419 | 2005-09-14 22:08:46 | [diff] [blame] | 88 | if __name__ == '__main__': |
Pearu Peterson | e8fa013 | 2003-03-07 18:08:28 | [diff] [blame] | 89 | setup_package() |